Jacar mascot — reading along A laptop whose eyes follow your cursor while you read.
Cómo Instalar

How to Install Docker on Ubuntu 20.04

How to Install Docker on Ubuntu 20.04

Actualizado: 2026-05-03

Docker[1] is a system that lets you encapsulate applications inside containers: portable software units that include everything needed to run an application in isolation — services, configurations, data and dependencies — without having to adapt the host server. This article explains how to install Docker on Ubuntu 20.04 from the official repository.

Key takeaways

  • Docker containers are lighter than virtual machines because they share the host operating system kernel.
  • The official Ubuntu repository doesn’t always include the latest Docker version — installing from Docker’s own repository ensures the most recent release.
  • Adding your user to the docker group lets you run commands without sudo.
  • Verify the installation with docker --version and docker run hello-world to confirm the daemon is active.

What is Docker and why use it?

Docker is the world’s most widely used container platform. Unlike virtual machines, which virtualise the complete hardware stack, Docker containers share the host operating system kernel. This makes them:

  • Faster to start (seconds rather than minutes).
  • Lighter on memory and disk.
  • Easier to move between servers or cloud environments.
  • Reproducible: the same container behaves identically in development, staging and production.
Docker official logo, container engine

Prerequisites

  • A server running Ubuntu 20.04[2].
  • Access to a user with sudo privileges.

Install Docker from the official repository

Ubuntu’s package repository doesn’t always offer the latest Docker version. To get the most recent release, install from Docker’s repository. First update the package index and add the necessary dependencies:

bash
sudo apt-get update
sudo apt install apt-transport-https ca-certificates curl software-properties-common

Add Docker’s GPG key to verify package authenticity:

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

Register the official Docker repository pointing to the focal stable branch:

bash
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
sudo apt-get update

Install Docker CE and configure permissions

Install Docker Community Edition and add your user to the docker group to run commands without sudo. The su - ${USER} command reloads the session so the group change takes effect:

bash
sudo apt-get install docker-ce
sudo usermod -aG docker ${USER}
su - ${USER}
Ubuntu logo — the same Docker installation flow applies across 20.04 and 22.04 LTS

Verify the installation

Check the installed version and confirm the Docker daemon is running:

bash
docker --version

For a more complete check, run the official test container:

bash
docker run hello-world

If the installation is correct, Docker will pull the hello-world image and display a confirmation message. With Docker installed, the natural next step is to install Docker Compose on Ubuntu 20.04 to manage multi-container applications, or set up Traefik as a reverse proxy to publish services on the internet.

Conclusion

Installing Docker from the official repository always guarantees the most recent, stable version, avoiding stale packages from Ubuntu’s own repository. With the user added to the docker group and the daemon active, the environment is ready to run and orchestrate containers immediately.

Was this useful?
[Total: 10 · Average: 4.4]
  1. Docker
  2. Ubuntu 20.04

Written by

CEO - Jacar Systems

Passionate about technology, cloud infrastructure and artificial intelligence. Writes about DevOps, AI, platforms and software from Madrid.