| Back to Tutorials

How to Install Docker on Ubuntu 20.04

Learn how to easily install and configure Docker on Ubuntu 20.04 with step-by-step instructions. Get your system ready for containerization with this simple tutorial.

Written by Fullstacko Team

How to Install Docker on Ubuntu 20.04

Introduction

Docker is a popular containerization platform that allows developers to package applications and their dependencies into lightweight, portable containers. This tutorial will guide you through the steps to install Docker on an Ubuntu 20.04 system.

Prerequisites

Before proceeding with the installation, ensure you have the following:

  • A system running Ubuntu 20.04
  • A user account with sudo privileges
  • Internet connectivity to download packages

Step 1 — Updating the Package List

To ensure that your system has the latest package information, update the local package index:

sudo apt update

Step 2 — Installing Required Dependencies

Docker requires some dependencies to be installed first. Run the following command:

sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
  • apt-transport-https: Enables APT to fetch packages over HTTPS for secure downloads.
  • ca-certificates: Ensures trusted certificates for secure communication.
  • curl: A command-line tool used to transfer data from URLs.
  • software-properties-common: Provides scripts for managing software sources.

Step 3 — Adding Docker’s Official GPG Key

To verify the authenticity of the Docker packages, add the GPG key:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

This step ensures that the packages you download are signed by Docker and have not been tampered with.

Step 4 — Adding the Docker Repository

Next, add the Docker APT repository to your system:

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Step 5 — Installing Docker

Now, update the package list again and install Docker:

sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io -y
  • docker-ce: The core Docker Engine package.
  • docker-ce-cli: The command-line tool to interact with Docker.
  • containerd.io: A container runtime that handles container lifecycle operations independently from the Docker daemon, improving stability and efficiency.

Step 6 — Verifying the Installation

Once installed, check the Docker service status:

sudo systemctl status docker

You should see output indicating that Docker is running. To further verify, run the following command:

docker --version

This should display the installed Docker version.

Step 7 — Running Docker Without Sudo (Optional)

By default, Docker requires root privileges. To allow your user to run Docker without sudo, add it to the Docker group:

sudo usermod -aG docker $USER

Then, log out and log back in for the changes to take effect.

Conclusion

You have successfully installed Docker on Ubuntu 20.04. You can now start using Docker to create and manage containers on your system. For further reading, check out Docker’s official documentation.

This tutorial was last updated on: 13:01:26 24 March 2025 UTC

Spread the word

Is this tutorial helping you? give kudos and help others find it.

Recommended tutorials

Other tutorials from our collection that you might want to read next.

How to Install Docker on Ubuntu 18.04

Learn how to easily install and configure Docker on Ubuntu 18.04 with step-by-step instructions. Get your system ready for containerization with this simple tutorial.

How to Install Docker on Ubuntu 22.04

Learn how to easily install and configure Docker on Ubuntu 22.04 with step-by-step instructions. Get your system ready for containerization with this simple tutorial.

How to Install Docker on Ubuntu 24.04

Learn how to easily install and configure Docker on Ubuntu 24.04 with step-by-step instructions. Get your system ready for containerization with this simple tutorial.

Boost your tech mindset.
Subscribe to our newsletters.

Get curated weekly analysis of vital developments, ground-breaking innovations, and game-changing resources in your industry before everyone else. All in one place, all prepared by experts.