How to Install Docker on Ubuntu 26.04
Complete step-by-step guide for the latest Ubuntu LTS
Docker allows you to run applications in lightweight, portable containers. Installing Docker on Ubuntu 26.04 (“Resolute Raccoon”) is straightforward when using the official Docker repository. This ensures you get the latest stable version with full support for Docker Compose and Buildx.
Prerequisites
- A fresh Ubuntu 26.04 LTS installation
- Sudo or root access
- Stable internet connection
- At least 2 GB RAM (recommended)
1. Update Your System
Start by updating the package index and upgrading existing packages.
2. Install Required Dependencies
3. Add Dockerโs Official GPG Key
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
4. Add the Docker APT Repository
“Types: deb”
“URIs: https://download.docker.com/linux/ubuntu”
“Suites: $(. /etc/os-release && echo $VERSION_CODENAME)”
“Components: stable”
“Signed-By: /etc/apt/keyrings/docker.asc” | \
sudo tee /etc/apt/sources.list.d/docker.sources > /dev/null
5. Install Docker Engine
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
6. Start Docker Service
sudo systemctl enable docker
7. Run Docker as a Non-Root User (Recommended)
Log out and log back in (or reboot) for the group change to take effect.
8. Verify Installation
Run the hello-world container:
Common Docker Commands
- docker ps โ List running containers
- docker images โ List downloaded images
- docker pull nginx โ Download an image
- docker run -d -p 8080:80 nginx โ Run a container
- docker compose up -d โ Start services from compose file
Tip: Always refer to the official Docker documentation for the most up-to-date instructions. To update Docker later, simply run sudo apt update && sudo apt upgrade.