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

How to Install Docker on Ubuntu 24.04

How to Install Docker on Ubuntu 24.04

Actualizado: 2026-05-18

Docker[1] is the most widely used container platform: it lets you build, ship, and run applications in isolated, reproducible environments. This guide explains how to install it on Ubuntu 24.04 LTS from the official repository, using the modern flow with a GPG key signed under /etc/apt/keyrings (the old apt-key add - is retired and won’t work on 24.04).

Key takeaways

  • Always install from Docker’s official repository, not Ubuntu’s: that’s how you get the most recent version and the Compose v2 plugin bundled in.
  • On Ubuntu 24.04 (Noble Numbat) the noble codename is read from /etc/os-release; the script splices it into the repository line automatically.
  • The GPG key goes in /etc/apt/keyrings/docker.asc and is referenced with signed-by= in sources.list.d. It’s the only method accepted since 22.04 and mandatory on 24.04.
  • The daemon is managed with systemctl; enabling it at boot saves you from starting it manually after every reboot.

Pre-installation steps

Update your system and make sure ca-certificates and curl are installed (they usually are):

sql
sudo apt update
sudo apt install -y ca-certificates curl

If you’re coming from older installs via Ubuntu’s packages or snaps, remove them first to avoid conflicts with docker-ce:

bash
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do
  sudo apt remove -y "$pkg" 2>/dev/null || true
done

Add the official Docker repository

Create the keyrings directory and download Docker’s GPG key:

nginx
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
  -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

Add the repository, referencing the key by path with signed-by=. The Ubuntu codename is read from /etc/os-release; on 24.04 it returns noble:

php
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" \
  | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
Ubuntu 24.04 LTS (Noble Numbat) logo, the reference operating system for this Docker installation

Ubuntu 24.04 LTS (Noble Numbat) logo, the reference operating system for this Docker installation

Install Docker CE

Install the engine plus the usual plugins (Buildx and Compose v2 ship as docker subcommands):

sql
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

After install, docker compose (no hyphen) works out of the box. The old standalone docker-compose binary is deprecated.

Configure the Docker daemon

The Docker daemon (dockerd) manages containers, images, networks, and volumes. Its configuration lives in /etc/docker/daemon.json:

nginx
sudo nano /etc/docker/daemon.json

Common options:

  • "log-driver": change the logging engine (defaults to json-file; production setups often move to journald or local).
  • "default-address-pools": customise IP ranges for container networks when they clash with the LAN.
  • "data-root": move Docker’s data directory to another partition (useful when /var/lib/docker grows).

After editing the file, reload the daemon:

nginx
sudo systemctl restart docker

Verify the installation

Check the installed versions:

sql
docker --version
docker compose version

Verify the daemon is active and configured to start with the system:

nginx
sudo systemctl status docker

The output should show active (running). If it doesn’t start automatically, enable it:

bash
sudo systemctl enable docker

A quick smoke test:

dockerfile
sudo docker run --rm hello-world
Docker logo, container engine that isolates applications from the runtime environment

Docker logo, container engine that isolates applications from the runtime environment

With Docker installed, the natural next steps are to orchestrate multi-container applications with Docker Compose (already bundled as docker compose), or set up Traefik as a reverse proxy to expose services on the internet. To run local LLMs on the same host, the Ollama guide covers the model catalogue and OpenAI-compatible API.

Conclusion

Installing Docker from the official repository on Ubuntu 24.04 LTS leaves you with the latest stable release, Compose v2 already bundled in, and the daemon ready under systemd. The apt-key flow is retired on 24.04. The signed-by= method pointing at /etc/apt/keyrings/docker.asc is the only one that survives a clean install.

Was this useful?
[Total: 0 · Average: 0]
  1. Docker

Written by

CEO - Jacar Systems

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