Updated: 11 October 2026 · Applies to: Docker Engine 29.9.0 with Compose v5.6.0 and Buildx 0.38.0 from Docker’s apt repository, tested on Ubuntu 26.04 LTS, Ubuntu 24.04 LTS and Debian 13

To install Docker on Ubuntu, add Docker’s own apt repository and run sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin. A plain apt install docker does not work, because no package has that name. According to Docker, the repository supports Ubuntu 26.04, 24.04 and 22.04 and Debian 13 and 12. We ran the steps below on Ubuntu 26.04, Ubuntu 24.04 and Debian 13; all three installed Docker 29.9.0 and Docker Compose v5.6.0.

Why apt install docker fails

$ sudo apt install docker
Package docker is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  wmdocker

Error: Package 'docker' has no installation candidate

That was Ubuntu 26.04; Debian 13 answered the same, and Ubuntu 24.04 too (its older apt starts the last line with E:). wmdocker is unrelated to containers. You have two real choices:

  • Docker’s repository (this guide): packages docker-ce and the Compose and Buildx plugins, always the current release.
  • Your distribution’s package docker.io: version 29.1.3 on Ubuntu 24.04 and 26.04 and 26.1.5 on Debian 13 at the time of writing. It works and updates on Ubuntu’s or Debian’s schedule. Compose then comes from docker-compose-v2 (Ubuntu) or docker-compose (Debian 13). Do not mix these packages with Docker’s.

1. Remove conflicting packages

On Ubuntu, Docker’s documentation lists these unofficial packages:

sudo apt remove $(dpkg --get-selections docker.io docker-compose docker-compose-v2 docker-doc docker-buildx podman-docker containerd runc | cut -f1)

On Debian, the list is the same without docker-compose-v2. On a fresh server you only see dpkg: no packages found matching ... lines, which is fine. Images and volumes in /var/lib/docker are kept.

2. Add Docker’s apt repository

sudo apt update
sudo apt install ca-certificates curl
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

sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF

sudo apt update

tee prints the file it wrote: check that it shows Suites: resolute (Ubuntu 26.04) or Suites: noble (Ubuntu 24.04). The second apt update should list download.docker.com.

Debian: use linux/debian in both URLs and this Suites line, which gave Suites: trixie on Debian 13:

Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")

3. Install Docker Engine

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

Our three test systems printed:

Docker version 29.9.0, build f415da8
Docker Compose version v5.6.0

On Debian and Ubuntu the Docker service starts by itself and at every boot (the packages enabled docker.service, docker.socket and containerd.service). Check with sudo systemctl status docker, then run the test image:

$ sudo docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
(rest of the message shortened)

Our lab containers cannot run the Docker daemon, so we printed this text by running the same hello-world image with Podman.

A specific version: apt list --all-versions docker-ce lists them, for example 5:29.8.2-1~ubuntu.26.04~resolute. Install one with sudo apt install docker-ce=VERSION docker-ce-cli=VERSION containerd.io docker-buildx-plugin docker-compose-plugin.

4. Use Docker without sudo (optional)

A normal user who is not in the docker group gets this error:

permission denied while trying to connect to the docker API at unix:///var/run/docker.sock

Add the user to the group (the packages create it), then log out and in again:

sudo usermod -aG docker $USER

According to Docker, the docker group grants root-level privileges, so add only users you trust. If you see Cannot connect to the Docker daemon instead, the service is not running: see is the Docker daemon running.

Firewall warning

According to Docker, ports you publish with -p bypass ufw and firewalld rules. For services that should only be reached through a reverse proxy on the same server, publish them on localhost only: -p 127.0.0.1:8080:80.

Docker Desktop for Ubuntu

Docker Desktop is a desktop app, not a server install. According to Docker, it needs x86-64 Ubuntu 26.04 or 24.04 with a desktop (GNOME, KDE or MATE), KVM virtualisation and at least 4 GB of RAM, and it runs Docker inside its own virtual machine, so it does not see containers from a Docker Engine on the same host. Commercial use in larger businesses (more than 250 employees or more than 10 million US dollars in annual revenue) needs a paid subscription. On a server or VPS, install Docker Engine as above.

The convenience script

Docker also offers get.docker.com. Its documentation says the script is not meant for production servers and may bring unexpected major upgrades, so use it only on throwaway test machines, and preview it first with sudo sh ./get-docker.sh --dry-run.

Update or uninstall

sudo apt update && sudo apt upgrade        # updates Docker with the rest of the system
sudo apt purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
sudo rm -rf /var/lib/docker /var/lib/containerd   # deletes ALL images, containers and volumes
sudo rm /etc/apt/sources.list.d/docker.sources /etc/apt/keyrings/docker.asc

Next steps: Docker Compose basics, list and remove containers, images and volumes and n8n with Docker Compose. On Fedora, see Docker on Fedora with dnf5. Docker runs well on a KVM VPS with full root access.

Official documentation: Docker on Ubuntu, Docker on Debian and post-installation steps.

Was this answer helpful? 0 Users Found This Useful (0 Votes)