Installing Docker on Ubuntu 20.04 LTS (Focal Fossa)

Aris Munawar, S. T., M. Sc.
2 min readDec 1, 2023

--

Docker

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. By taking advantage of Docker’s methodologies for shipping, testing, and deploying code, you can significantly reduce the delay between writing code and running it in production. Ability to install docker has become primary need for IT personnel nowadays. Therefore, this article will explain simple step to install docker, especially on Ubuntu 20.04 LTS (Focal Fossa)

Prerequisites

  • A server running on one of the following operating systems: Ubuntu 22.04, 20.04, 18.04, 16.04 or any other Debian-based distribution like Linux Mint
  • It’s recommended that you use a fresh installed OS to prevent any unexpected issues
  • Access to the root user

Installation Steps

  • Step 1. Make sure that all of your system packages are up-to-date and then install curl by running the following commands:
$ sudo apt update
$ sudo apt install apt-transport-https curl
  • Step 2. Installing Docker
$ sudo apt install docker.io
  • Step 3. Installing Docker’s service
$ sudo systemctl enable docker
$ sudo systemctl start docker

With the above command, docker will automatically run upon machine reboots.

  • Step 4. Verifying Docker installation
$ docker --version
Docker version 20.10.21, build 20.10.21-0ubuntu1~20.04.2

Step 5. Testing Docker

$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
719385e32844: Pull complete
Digest: sha256:c79d06dfdfd3d3eb04cafd0dc2bacab0992ebc243e083cabe208bac4dd7759e0
Status: Downloaded newer image for hello-world:latest

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:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/get-started/

The output of this command will be:

That was all about Docker installation on Ubuntu 20.04 LTS (Focal Fossa). For more tutorial about Docker, you can read the official documentation on its official website at https://docs.docker.com/get-started/.

In the next article we will learn about Installing Minikube on Ubuntu 20.04 LTS (Focal Fossa)

--

--

Aris Munawar, S. T., M. Sc.

Lecturer, Fullstack Software Developer, Proficient on Desktop/Mobile Automation, Dynamic Programming & Instrument Interfacing