Install Docker – Ubuntu Focal 20.04

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

  • Distribution: Ubuntu Focal 20.04 (LTS)

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 \
software-properties-common

Set up the Docker repositories

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository "deb [arch=amd64] \
https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable"

Install Docker packages

sudo apt-get update

sudo apt-get install -y docker-ce docker-ce-cli containerd.io

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:

WordPress.com Logo

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

Google photo

You are commenting using your Google 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