A container image packages an application and its dependencies. On Ubuntu 26.04 LTS, you can install Docker Engine from Docker's official APT repository to run containers from those images.
APT uses a repository-specific signing key to verify Docker's package index. Adding the stable repository lets Docker's packages receive updates through APT alongside packages from Ubuntu.
The Docker daemon manages containers and their networking for the whole host. Membership in the docker group grants root-level access through that daemon, so use sudo for the Docker commands.
Steps to install Docker Engine on Ubuntu:
Use an SSH session to the server or its console with an account that can use sudo. Start on Ubuntu 26.04 LTS with no Docker installation, Docker APT source, or Docker signing key. The server needs outbound access to the Ubuntu archive, Docker's repository, and Docker Hub.
Installing the packages starts Docker and adds rules for container networking. Ports you later publish through Docker can bypass UFW rules. On a server already in use, keep console access and a current backup so you can recover if installation disrupts the host.
- Check for packages that conflict with Docker's packages.
$ apt list --installed docker.io docker-compose docker-compose-v2 docker-doc docker-buildx podman-docker containerd runc
The list should contain no package rows. If any appear, stop and review Docker's precautions for conflicting packages before removing them. An existing service may depend on
containerdorrunc. - Refresh the Ubuntu package indexes.
$ sudo apt update
- Install
ca-certificatesandcurlfor downloading the signing key over HTTPS.$ sudo apt install ca-certificates curl
- Prepare the
/etc/apt/keyringsdirectory for the repository key.$ sudo install -m 0755 -d /etc/apt/keyrings
- Download Docker's signing key to
/etc/apt/keyrings/docker.asc.$ sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
- Make
/etc/apt/keyrings/docker.ascreadable by APT.$ sudo chmod a+r /etc/apt/keyrings/docker.asc
- Register Docker's stable APT repository in
docker.sources.$ 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 EOFThe entry takes the release codename and architecture from the server.
Signed-Bytells APT which key to use for this repository. - Refresh the package indexes with Docker's repository enabled.
$ sudo apt update
APT should list Docker's
resolute InReleasewithout a repository or signature error. If APT rejects the new source, stop before installing. Moving the newly createddocker.sourcesfile out of/etc/apt/sources.list.d/lets APT refresh without that entry. - Install Docker Engine, its CLI, containerd, Buildx, and the Compose plugin.
$ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
If APT proposes removing packages, decline the transaction and check the dependencies before retrying.
- Confirm that the installed Engine and containerd versions match packages from Docker's stable repository.
$ apt-cache policy docker-ce containerd.io docker-ce: Installed: 5:29.10.1-1~ubuntu.26.04~resolute Candidate: 5:29.10.1-1~ubuntu.26.04~resolute Version table: *** 5:29.10.1-1~ubuntu.26.04~resolute 500 500 https://download.docker.com/linux/ubuntu resolute/stable arm64 Packages ##### snipped ##### containerd.io: Installed: 2.4.2-4~ubuntu.26.04~resolute Candidate: 2.4.2-4~ubuntu.26.04~resolute Version table: *** 2.4.2-4~ubuntu.26.04~resolute 500 500 https://download.docker.com/linux/ubuntu resolute/stable arm64 Packages ##### snipped #####Under each package, look for
download.docker.comunder the installed version marked***. The version and architecture can differ from the output shown. - Confirm that the Docker service is running.
$ systemctl is-active docker active
If the result is anything other than
active, see Docker's daemon troubleshooting instructions before continuing. - Check that the Docker client reports the Engine's server version.
$ sudo docker version Client: Docker Engine - Community Version: 29.10.1 ##### snipped ##### Server: Docker Engine - Community Engine: Version: 29.10.1 ##### snipped #####
A
Clientsection alone only proves that the CLI is installed. TheServersection confirms that it reached the daemon. - Run Docker's
hello-worldtest container.$ sudo docker run hello-world Hello from Docker! This message shows that your installation appears to be working correctly. ##### snipped #####
On the first run, Docker downloads the image from Docker Hub. The container prints the greeting and exits. The image and stopped test container remain on the server.