How to Install Docker on Ubuntu 22.04
Actualizado: 2026-05-03
Docker[1] is the most widely used container platform: it lets you build, ship, and run applications in isolated and reproducible environments. It provides a secure and reliable platform for developing and distributing software independently of the underlying environment. This guide explains how to install Docker on Ubuntu 22.04 from the official repository.
Key takeaways
- Always install from Docker’s official repository, not Ubuntu’s — this guarantees the most recent version.
- Ubuntu 22.04 uses
lsb_release -csto detect the system codename (jammy) when adding the repository. - The Docker daemon is managed with
systemctl; enablingdocker.serviceat boot avoids having to start it manually. - Verify the installation with
docker --versionandsystemctl status dockerbefore proceeding with other components.
Pre-installation steps
Before starting, make sure your Ubuntu system is up to date:
sudo apt updateInstall the support packages needed to add external repositories:
sudo apt-get install apt-transport-https ca-certificates curl software-properties-commonAdd the official Docker repository
Add Docker’s GPG key to verify package authenticity:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -Register the official repository, automatically pointing to the installed Ubuntu version (on Ubuntu 22.04, lsb_release -cs returns jammy):
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"Update the package index so the system recognises the new repository:
sudo apt updateInstall Docker CE
Install Docker Community Edition:
sudo apt install docker-ceConfigure the Docker daemon
The Docker daemon (dockerd) is the background process that manages all containers, images, networks, and volumes. Its configuration is defined in /etc/docker/daemon.json. To edit the configuration:
sudo nano /etc/docker/daemon.jsonCommon configuration options include:
"log-driver": change the logging engine (defaults tojson-file)."default-address-pools": customise IP ranges for container networks."data-root": move Docker’s data directory to another partition.
After modifying the configuration file, restart the daemon to apply changes:
sudo systemctl restart dockerVerify the installation
Check the installed version:
docker --versionVerify the daemon is active and configured to start with the system:
sudo systemctl status dockerThe output should show active (running). If Docker doesn’t start automatically, enable it:
sudo systemctl enable dockerWith Docker installed, the natural next steps are to install Docker Compose to orchestrate multi-container applications, or set up Traefik as a reverse proxy to expose services on the internet. For observability over container clusters, the post on Pixie for Kubernetes covers complementary tooling.
Conclusion
Installing Docker from the official repository on Ubuntu 22.04 ensures you always get the most stable and recent version, avoiding stale packages. With the daemon active and configured to start automatically, the environment is ready to build and run containers immediately.