This article describes how to install Docker CE in Ubuntu 18.04 LTS. Follow the steps below to install Docker in Ubuntu 18 using the repository, or you can refer the official Docker Docs for other options.
Docker is a popular container platform. Visit the official Docker website for more info: https://www.docker.com/
How to install Docker
Launch a new terminal window
First, make sure
sudo apt-get update
sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
Add Docker’s GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Enter the below to get the latest stable docker repository:
sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
Now we can install Docker with the following commands:
sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io
Finally, verify the installation by running the
sudo docker run hello-world
hello-worldimage will not exist, so Docker will download it then run it. You should see something like the below: