Install Docker – Ubuntu Focal 20.04

Installing Docker on Linux can be tricky. Follow the instructions step by step.

  • Distribution: Ubuntu Focal 20.04

Check the Ubuntu release version

lsb_release -d

Update the apt package

  • Update the apt package index and install packages to allow apt to use a repository over HTTPS:
sudo apt-get update

sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \

Set up the Docker repositories

curl -fsSL | sudo apt-key add -

sudo add-apt-repository "deb [arch=amd64] \ \
$(lsb_release -cs) stable"

Install Docker packages

sudo apt-get update

sudo apt-get install -y docker-ce docker-ce-cli

sudo apt-mark hold docker-ce

Confirm installation of Docker

sudo docker version

Use Docker as a non-root user

sudo usermod -aG docker <user-name>

docker version
  • You need to log out and log in again.

Run docker

docker run hello-world

Leave a Comment

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s