Install Docker Engine from Docker’s signed APT repository when you want current Docker packages and the Compose and Buildx plugins. Docker’s Ubuntu instructions currently support 64-bit Ubuntu 22.04, 24.04 and 26.04 on listed architectures. Confirm your release before changing repositories.
Remove conflicting packages
Docker documents several distro packages that can conflict with its packages. Review what APT proposes before confirming removal:
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; doneAPT may report that some packages are not installed. Existing images under /var/lib/docker are not automatically removed, but back up anything important before replacing a container runtime.
Add Docker signed APT repository
sudo apt-get update
sudo apt-get 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
. /etc/os-release
printf 'deb [arch=%s signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu %s stable\n' $(dpkg --print-architecture) ${UBUNTU_CODENAME:-$VERSION_CODENAME} | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get updateOn derivative distributions, confirm that the Ubuntu codename resolves to a base release Docker supports.
Install Docker Engine and plugins
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-pluginIf APT reports a lock, do not delete the lock file; follow the dpkg lock checklist. If it cannot find the packages, use the APT repository diagnostic guide.
Verify the daemon
sudo systemctl status docker
sudo docker run hello-world
docker compose versionThe test image downloads and runs a small container. If the service is inactive, inspect it with the systemctl service guide and journalctl -u docker -b.
Understand access and firewall behavior
Membership in the docker group grants root-level privileges through the daemon. Keep using sudo unless you understand that access model. Docker also warns that published container ports can bypass rules managed only through UFW or firewalld; place filtering rules in the appropriate Docker-compatible chain and test them.
Sources and verification
Package names and repository steps checked against Docker’s official Ubuntu installation page on September 11, 2026. The commands were not run against this publishing host.
