How to install Docker on Ubuntu 20.04 TLS in 7 steps

Written by

1. Update your existing list of packages:

sudo apt update

2. Install a few prerequisite packages which let apt use packages over HTTPS:

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

3. Add the GPG key for the official Docker repository to your system:

curl -fsSL | sudo apt-key add -

4. Add the Docker repository to APT sources:

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

5. Make sure you are about to install from the Docker repo instead of the default Ubuntu repo:

apt-cache policy docker-ce

You will see the output like this:

Notice that docker-ce is not installed, but the candidate for installation is from the Docker repository for Ubuntu 20.04

6. Install Docker:

sudo apt install docker-ce

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

sudo systemctl status docker


Leave a Reply

Your email address will not be published. Required fields are marked *