How to Install Docker on Ubuntu 26.04

Docker is an open-source container platform that packages applications with their dependencies into portable, isolated units called containers. Containers share the host operating system kernel, making them lightweight and fast to start compared to traditional virtual machines. Docker is widely used for application deployment, microservices architectures, and CI/CD pipelines.
This article explains how to install Docker on an Ubuntu 26.04 server, manage the Docker service, and run a containerized application.
Prerequisites
Before you begin, you need to:
- Have access to an Ubuntu 26.04 server instance as a non-root user with sudo privileges.
Install Docker
The official Docker repository provides the latest Docker Engine packages. The following steps add the Docker GPG key and repository to APT, then install the Docker Engine with its companion plugins.
Install the required dependency packages.
console$ sudo apt install apt-transport-https ca-certificates curl -y
Add the Docker GPG key to the server's keyring.
console$ sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
Add the Docker repository to the APT sources.
console$ 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
Update the APT package index to include the new repository.
console$ sudo apt update
Install Docker Engine and its plugins.
console$ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
The command installs the following packages:
docker-ce: The Docker Engine community edition.docker-ce-cli: The Docker command-line interface.containerd.io: The container runtime that manages container lifecycles.docker-buildx-plugin: Extends Docker's build capabilities for multi-platform images.docker-compose-plugin: Enables multi-container application management using YAML configuration files.
Confirm the installed Docker version.
console$ docker --version
Your output should be similar to the one below:
Docker version 29.3.1, build c2be9cc
Manage the Docker System Service
The docker systemd service controls the Docker Engine process. The following steps enable automatic startup and demonstrate the core service management commands.
Enable Docker to start automatically at boot time.
console$ sudo systemctl enable docker
Verify that Docker is active and running.
console$ sudo systemctl status docker
The output should display
active (running), confirming that the Docker Engine is operational.Stop the Docker service.
console$ sudo systemctl stop docker
Restart the Docker service.
console$ sudo systemctl restart docker
Add User to the Docker Group
By default, Docker commands require sudo privileges. Adding your user to the docker group allows running Docker commands without sudo.
Add the current user to the
dockergroup.console$ sudo usermod -aG docker $USER
Apply the group membership changes by logging out and back in, or run the following command.
console$ newgrp docker
Verify that Docker commands work without
sudo.console$ docker ps
The command returns an empty container list without a permission error, confirming that the group membership is active.
Run a Containerized Application
Docker pulls container images from registries such as Docker Hub and runs them as isolated containers. The following steps pull an Nginx image, run it as a container, and verify access to the application.
Pull the latest Nginx image from Docker Hub.
console$ docker pull nginx:latest
List all Docker images on the server.
console$ docker images
Verify that the
nginximage with thelatesttag is listed in the output.Run a container using the Nginx image and map host port
80to container port80.console$ docker run --name example-nginx -d -p 80:80 nginx:latest
Within the command:
--name example-nginx: Assigns the nameexample-nginxto the container.-d: Runs the container in detached mode as a background process.-p 80:80: Maps the host port80to the container port80.
List all running containers.
console$ docker ps
Verify that the
example-nginxcontainer is listed with a status ofUp.Allow HTTP traffic on port
80through the firewall.console$ sudo ufw allow 80/tcp
Access the server's public IP address in a web browser. The default Nginx welcome page confirms that Docker is serving the container.
http://SERVER-IP
Conclusion
You have installed Docker on an Ubuntu 26.04 server, configured the service for automatic startup, and deployed a containerized Nginx application. Docker supports building custom images, multi-container deployments with Docker Compose, and integration with container registries for image distribution. For more information, refer to the official Docker documentation.