How to Install Docker on Ubuntu 20.04

Install Docker on Ubuntu 20.04

In this article, we will have explained the necessary steps to install and configure Docker on Ubuntu 20.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Docker is an application that makes it simple and easy to run application processes in a container, which are like virtual machines, only more portable, more resource-friendly, and more dependent on the host operating system.

Install Docker on Ubuntu

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

sudo apt update
sudo apt upgrade

Step 2. Install Docker on Ubuntu system.

To install Docker CE from Docker, you first need to install some required packages by executing the command below:

sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

Next, install the Docker repository GPG signing key:

curl -fsSL | sudo apt-key add -

Then, Install the Docker repository on Ubuntu 20.04:

echo "deb [arch=amd64] bionic stable" > /etc/apt/sources.list.d/docker-ce.list

After that, Install Docker CE and other tools including  using the following command:

sudo apt update
sudo apt install docker-ce docker-ce-cli

Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running:

docker --version

To start and enable Docker and Containers service to run on system boot:

systemctl enable --now docker containerd

Step 3. Create a docker container.

So, finally, the Docker is on our Focal Fossa, it’s time to run and check whether it is able to pull container images from Docker Hub:

docker run hello-world

Run the downloaded image:

docker run hello-world

That’s all you need to do to install Docker on Ubuntu 20.04 Focal Fossa. I hope you find this quick tip helpful. Don’t forget to share your valuable queries/suggestions in the below comment box & also drop your worthwhile feedback.