Install Docker CE on Ubuntu 18.04 | 18.10 | 20.04
Docker CE can be used to create containers for free. This is a rebranded open-source alternative to Docker that has been freely available since Docker was launched in 2013. Among the operating systems supported by CE are Windows 10 and Mac, Azure and AWS, as well as CentOS, Debian, Fedora, and Ubuntu. For users who are looking to integrate cloud services into applications, it is utilized as a container system.
Throughout this guide, we provide instructions on how to install Docker CE on Ubuntu 18.04, 18.10, and 20.04.
So let’s begin,
Step 1: Getting your system up and running
- Sign in to your system or register a newly created one by logging in to your VPSie account.
- Connect by SSH using the credentials we emailed you.
- Once you have logged into your Ubuntu instance, run these commands to update your system.
apt-get update && apt-get upgrade -y
Step 2: Remove old versions
Skip this step if your machine is brand new. Docker used to be called docker.io, docker or docker-engine. Uninstall them if you have them installed on your machine:
sudo apt-get remove docker docker-engine docker.io containerd runc
Step 3: Configure the repository
Set up apt to use an HTTPS repository by installing the following packages:
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
Include Docker’s GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Make sure you have the fingerprint for the key at hand 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 using the following methods:
sudo apt-key fingerprint 0EBFCD88
pub rsa4096 2017-02-22 [SCEA] 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 uid [ unknown] Docker Release (CE deb) <[email protected]> sub rsa4096 2017-02-22 [S]
Set up the stable repository by running the following command,
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Step 4: Installation of Docker CE
Create an updated apt package index,
sudo apt-get update
Install Docker CE and containers using the latest version,
sudo apt-get install docker-ce docker-ce-cli containerd.io
Step 5: Create and test user
Once the group is created, users are not added, so let’s add them
adduser user usermod -aG docker user
Start the Docker service again,
systemctl restart docker
Test the installation by running the Docker hello-world container,
docker run hello-world
# docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
For more examples and ideas, visit:
Step 6: Set Docker to start on boot
Run the following command,
systemctl enable docker
Docker has been installed successfully. Check out the official documentation to learn more.
Thanks for reading! I hope it was informative for you!
Docker CE (Community Edition) is a free, open-source containerization platform that allows developers to package their applications and dependencies into lightweight, portable containers.
You can start and stop Docker services on Ubuntu by running the following commands:
To start Docker:
sudo systemctl start docker
To stop Docker:
sudo systemctl stop docker
You can check the version of Docker installed on Ubuntu by running the following command:
You can run a Docker container on Ubuntu by following these steps:
Pull the Docker image you want to run by running the following command:php
docker pull <image_name>
Run the Docker container by running the following command:arduino
docker run <image_name>
You can remove a Docker image on Ubuntu by running the following command:
docker rmi <image_name>
You can configure Docker on Ubuntu by modifying the /etc/docker/daemon.json file. You can add or modify settings in this file to configure Docker according to your requirements.
You can troubleshoot Docker issues on Ubuntu by checking the logs using the following command:
docker logs <container_name>
You can also use the following command to get more information about Docker: