Installing Docker on Ubuntu is a straightforward process that can be completed in just a few steps.
- Start by updating your system’s package index by running the following command in the terminal:
Copy codesudo apt-get update
- Next, install the necessary packages for adding the Docker repository to your system by running the following command:
Copy codesudo apt-get install apt-transport-https ca-certificates curl software-properties-common
- Add the Docker repository to your system by running the following command:
Copy codecurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- Add the Docker repository to your system’s software sources by running the following command:
Copy codesudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- Update your system’s package index again by running the following command:
Copy codesudo apt-get update
- Finally, install Docker by running the following command:
Copy codesudo apt-get install docker-ce
You can verify that Docker is installed and running by running the following command:
Copy codesudo systemctl status docker
You can also run a simple test by running the “hello-world” image with the following command:
Copy codedocker run hello-world
You now have Docker installed on your Ubuntu system and you can use it to run containerized applications.
Leave a Reply