How To Install Docker On Ubuntu 20.04 LTS?

How To Install Docker On Ubuntu 20.04 LTS?


This post was last updated on August 1st, 2020 at 08:47 pm

Docker is a platform that makes it easier to create, deploy, and use an application using containers. A container contains an application with all parts of it needed such as libraries and other dependencies, and ships it as one package.

Instead of using dedicated resources like virtual machines, docker shares kernel, and other resources of the host system. There are two versions of the Docker: Docker CE(Community Edition), Docker EE (Enterprise Edition). Docker CE is a community-supported version available for free. You can use it for small scale projects or learning.

This article describes how to install and use Docker CE on Ubuntu 20.04 LTS.

Install Docker CE from Docker’s official repository

You can install it from the standard Ubuntu repository but you may not get its latest version. So we will install it from the docker’s official repository.

Setup docker’s official repository

Before we start installing docker we need to set up its official repository, so that we can install and upgrade it easily. Follow the below steps –

First, update the apt package index by using –

sudo apt update

Install the following packages to allow apt to use a repository over HTTPS –

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

Now add the official GPG key of docker –

curl -fsSL | sudo apt-key add -

Add the docker stable repository to apt sources, remember to replace the architecture and name of the distribution with your own –

sudo add-apt-repository "deb [arch=amd64] focal stable"

Now again run the apt update command –

sudo apt update

Install Docker CE

Install the community edition of Docker using the following command –

sudo apt install docker-ce

You can verify the installation by using –

docker --version

Test the docker with hello-world container

You can test the docker by running the hello-world container on Ubuntu 20.04 LTS. Use the following command in your terminal –

sudo docker run hello-world

If the message appears like given in the image that means docker installed in your system is working correctly.

If you want to run docker command without sudo, you need to add your username to the docker group. You can use the following command to add a user to the docker group –

sudo usermod -aG docker {username}

For example –

sudo usermod -aG docker lalit

Now log out and re-login or use the following command to apply the membership of the user.

su {username}

This will ask the password of the current user, enter it. Now you can run the docker command without sudo.


If you want to know more about the options and commands that can be used with the docker then run docker command without any argument. This will display the complete list of options and commands. You can also see its manual page by executing man docker in the terminal.

Previous What Is Buzz B Gone?
Next [ubuntu] Bluetooth not working

About author

You might also like

Linux Topics 0 Comments

How To Check System Hardware Information In Ubuntu 20.04 LTS?

This post was last updated on August 1st, 2020 at 12:20 pmA computer system is consists of different types of hardware such as processor, RAM, hard disk, network cards, etc.

How To 0 Comments

How To Assemble Files With Cat Command In Linux/Unix?

This post was last updated on August 1st, 2020 at 12:38 pmLinux or Unix provides cat command that can be used to create, view, and concatenate files. It reads the

How To 0 Comments


This post was last updated on November 3rd, 2020 at 05:39 pmks.cfg stuff: // ks-merged-ks.cfg.html – A kickstart that works for 7.2, AS2.1, 7.3, 8.0, and 9 – This


No Comments Yet!

You can be first to comment this post!

Leave a Reply