The wrong way to install Docker on Ubuntu is the one that looks easiest: sudo apt install docker.io. That package exists, it installs, and it runs a container. It is also whatever version happened to be frozen into the archive when 26.04 was cut, it lags the real releases by months, and it ships without the Compose and Buildx plugins you will want by the end of the week. Use Docker's own apt repository instead, and this is the post I keep open so I do not re-derive the repo setup from memory each time.
This is short on purpose. The steps are the official ones, and the only place worth slowing down is step 5, where adding yourself to the docker group quietly hands out root. That tradeoff is the part most guides skip, and it is the one thing here actually worth reading twice.
TL;DR Remove any distro
docker.io/containerdpackages, add Docker's GPG key and the deb822.sourcesrepo, thensudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin. Verify withsudo docker run hello-world. Add yourself to thedockergroup to drop thesudo(it is root-equivalent, more below).
Prerequisites
- Ubuntu 26.04 (Resolute Raccoon), server or desktop, on
amd64orarm64. - A user with sudo. If you are still on root, runs the whole daemon as your user instead, at the cost of a few limitations around ports below 1024 and some networking.
Quick reference
Job
Command
Remove distro packages
`sudo apt remove $(dpkg --get-selections docker.io docker-compose docker-compose-v2 docker-doc podman-docker containerd runc \
Add GPG key
{% raw %} sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
Install engine + plugins
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Verify
sudo docker run hello-world
Drop the sudo
sudo usermod -aG docker $USERthen re-login
Compose command
docker compose up(space, notdocker-compose)
Check the daemon
systemctl is-active docker
Use Docker's repo, not the distro package, so you get real versions and the Compose and Buildx plugins. Clear out the old packages first, trust the key, and let apt pull the real thing. Then decide with open eyes whether the
dockergroup is a trade you want, because it hands out root. With that done, the box is ready for the actual reason you installed Docker: running something. A natural next step is putting .↗ Original-Artikel auf dev.to lesenVollständiger Original-ArtikelDen kompletten Beitrag mit allen Details direkt auf dev.to lesen.
SOCIAL SHARE CARD GENERATOR