Install Docker on Ubuntu 20.04

Laxfed Paulacy
2 min readJan 4, 2023

Gonna need this one if you want to keep up, bruh.

Update the package manager index:

sudo apt-get update

Install packages to allow apt to use a repository over HTTPS:

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

Add Docker’s official GPG key:

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

Add the Docker repository to APT sources:

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

Update the package manager index again:

sudo apt-get update

Install Docker:

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

Verify that Docker is installed and running correctly:

sudo docker run hello-world

Result:

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:

  1. The Docker client contacted the Docker daemon.
  2. The Docker daemon pulled the “hello-world” image from the Docker Hub. (amd64)
  3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading.
  4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.

To try something more ambitious, you can run an Ubuntu container with:

docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:

For more examples and ideas, visit:

--

--

Laxfed Paulacy
Laxfed Paulacy

Written by Laxfed Paulacy

Delivering Fresh Recipes, Crypto News, Python Tips & Tricks, and Federal Government Shenanigans and Content.

No responses yet