In this article, we will see how to install Docker on Ubuntu.
1. Update the apt package index.
sudo apt-get update
2. Install packages to allow apt to use a repository over HTTPS.
sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
3. Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
4. Use the following command to set up the stable repository:
sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
5. Again Update the apt package index.
sudo apt-get update
6. Install the latest version of Docker Engine and containerd
sudo apt-get install docker-ce docker-ce-cli containerd.io
Type Y to continue.
Docker successfully installed on Ubuntu 20.04 LTS.
Post Docker Installation steps on Ubuntu:
Lets verify the docker version with below command.
docker -v
Lets verify the docker is started or not by running below command.
sudo sytemctl status docker
Verify that Docker Engine is installed correctly or not by running the hello-world image.
sudo docker run hello-world