To install Docker on Ubuntu 26.04 LTS, the three main options are the official Docker CE repository, the Ubuntu repository (docker.io), and the Snap Store. For developers and server administrators who need the latest stable engine, the official Docker CE repository is the recommended path. This guide walks through the complete installation, GPG keyring registration, post-install permissions, and Docker Compose setup step by step.
Engine, Compose & Post-Install Guide
Set up the official Docker CE repository, register the GPG signing key, install the Engine and Compose plugin, configure non-root permissions, and verify your container runtime in one complete walkthrough.
Docker is a container runtime that lets you package an application and all its dependencies into a single portable unit. Instead of configuring a full virtual machine, containers share the host kernel and start in milliseconds. On Ubuntu 26.04 LTS, the cleanest way to install Docker is directly from Docker’s official APT repository, which always ships the latest engine with security patches ahead of any distribution-maintained package.
Choosing the Right Installation Method
There are three ways to get Docker onto Ubuntu 26.04. The table below compares them honestly so you can pick what fits your workflow.
| Method | Version Age | Auto-Updates | Sandboxing | Best For |
|---|---|---|---|---|
| Docker CE (Official repo) | Always current | Yes, via APT | No extra layer | Developers, servers, production |
| docker.io (Ubuntu repo) | Lags 1-2 versions | Yes, via APT | No extra layer | Minimal setups, quick scripting |
| Snap Store | Usually current | Yes, automatic | Strict confinement | Desktop users who want simplicity |
The rest of this guide focuses on Option A: Docker CE via the official repository. It is the method Docker Inc. recommends and the one that gives the most control over versioning, daemon configuration, and plugin management.
How to Install Docker CE on Ubuntu 26.04 LTS
Open a terminal (Ctrl+Alt+T) and follow these steps in order.
Refresh your package index and install the transport utilities Docker’s installer needs to communicate with HTTPS sources:
sudo apt update sudo apt install -y ca-certificates curl gnupg
Create the keyrings directory, download Docker’s GPG key, and set the correct permissions so APT can read it:
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
This stores the key in the modern /etc/apt/keyrings/ directory rather than the older /etc/apt/trusted.gpg.d/ location, which is the current best practice.
Register the Docker stable repository using your system’s detected codename:
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
The
$VERSION_CODENAME variable resolves to resolute on Ubuntu 26.04. If the next apt update step throws a 404 Not Found error, it means Docker has not published a dedicated index for resolute yet. See the Troubleshooting section below for the one-line fix.Update the package index again to pick up the Docker repository, then install the full engine bundle:
sudo apt update sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
docker compose, not docker-compose.Confirm the Docker daemon is running, then pull and run the official test image:
sudo systemctl status docker sudo docker run hello-world
A successful run prints Hello from Docker! followed by a brief description of what just happened. If you see this message, Docker Engine is installed and working correctly.
Post-Installation Settings
Two settings are worth configuring immediately after installation: auto-start on boot, and non-root user access. Both are optional but strongly recommended for any regular workflow.
On Ubuntu 26.04, Docker CE registers itself with systemd during installation. To confirm it starts automatically after a reboot:
sudo systemctl enable docker sudo systemctl enable containerd
If you ever want to disable this, replace enable with disable in both commands.
By default, only root can communicate with the Docker daemon. To allow your normal user account to run Docker commands without prefixing every command with sudo, add your user to the docker group:
sudo usermod -aG docker $USER
The group change does not take effect in your current terminal session. You must log out and log back in (or reboot) before Docker commands work without sudo. To verify after logging back in, run:
docker ps. If it returns a blank table instead of a permission error, the change worked.Using Docker Compose on Ubuntu 26.04
Docker Compose is already installed as a plugin if you followed Step 4 above. There is no separate download needed. [ Read our full guide on how to use Docker Compose ]
Check the installed Compose version to confirm it is working:
docker compose version
The output should read something like Docker Compose version v2.x.x.
docker compose up -d docker compose down docker compose ps
docker-compose up -d docker-compose down docker-compose ps
The docker-compose binary is no longer included in current Docker installations. If you see a “command not found” error with the hyphenated version, switch to the space syntax above.
Troubleshooting Common Docker Issues
If you get a permission denied while trying to connect to the Docker daemon socket error after adding yourself to the docker group, your session has not refreshed yet. Apply the group change without logging out:
newgrp docker
This refreshes your group membership in the current shell. Run docker ps again to confirm it works. For a permanent fix, log out and back in as described in Step 5.
If sudo apt update shows a 404 error for the Docker repository, it means Docker has not published a native resolute index yet. Replace the codename with noble (Ubuntu 24.04), which is fully compatible:
sudo sed -i 's/resolute/noble/g' /etc/apt/sources.list.d/docker.list sudo apt update
Docker CE packages built for Ubuntu 24.04 (noble) install and run correctly on Ubuntu 26.04. The sed command replaces the codename in-place. After the update completes, continue from Step 4.
If containers can ping IP addresses but cannot resolve hostnames (for example, apt update inside a container fails), it is likely a conflict with Ubuntu’s systemd-resolved stub listener on 127.0.0.53. Fix it by pointing Docker to a public DNS server in the daemon config:
sudo mkdir -p /etc/docker
echo '{"dns": ["1.1.1.1", "8.8.8.8"]}' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker
This sets Cloudflare DNS (1.1.1.1) and Google DNS (8.8.8.8) as fallbacks for all containers. Restart a test container and run ping google.com inside it to verify the fix.
Frequently Asked Questions
What is the difference between Docker CE and docker.io on Ubuntu?
Docker CE (Community Edition) is installed from Docker’s own official APT repository and always receives the latest stable release first. The docker.io package is maintained by Ubuntu and tends to lag several versions behind. For most developers and servers, the official Docker CE repository is the recommended choice.
Do I need to use sudo before every docker command?
By default, yes. Docker requires root privileges to communicate with the Docker daemon. To remove the need for sudo, add your user to the docker group by running: sudo usermod -aG docker $USER. Then log out and back in for the group change to apply.
How do I check which version of Docker is installed on Ubuntu?
Open a terminal and run: docker –version. For more detail including the server daemon version, run: docker version. Both commands work without sudo if you have already added your user to the docker group.
What is the difference between docker-compose and docker compose?
docker-compose (with a hyphen) is the older standalone Python binary that is now deprecated. docker compose (with a space) is Docker Compose V2, a native Go plugin built directly into the Docker CLI. On Ubuntu 26.04, if you install docker-compose-plugin via the official APT repository, you use the space syntax: docker compose up.
Why does my apt update show a 404 error after setting up the Docker repository?
This happens because Docker’s APT repository may not yet have a dedicated index for Ubuntu 26.04 (codename resolute). The fix is to open /etc/apt/sources.list.d/docker.list and replace resolute with noble, which is the Ubuntu 24.04 codename. Docker CE packages built for noble are fully compatible with Ubuntu 26.04.
More Ubuntu 26.04 guides: How to use Docker Compose on Ubuntu · Upgrade to Ubuntu 26.04 LTS · Ubuntu Keyboard Shortcuts · Ubuntu Server 26.04 Manual
