News
New Serverspace Data Center in Uzbekistan: Tashkent Located
Serverspace Black Friday
DS
Daniel Smith
May 25 2026
Updated May 28 2026

How to install Docker on Ubuntu 26.04 LTS

Docker FAQ Ubuntu

Docker is one of the most widely used tools for running containerized applications. It lets you package an application together with all its dependencies into an isolated environment and run it the same way on any machine: local, test, or production. That is why Docker is used in development, CI/CD pipelines, and when deploying microservices.

Ubuntu 26.04 LTS was released in April 2026 and brought an updated set of system libraries, Linux kernel 6.14, and long-term support until 2031. In this article, we will look at how to install Docker Engine and Docker Compose on a fresh Ubuntu 26.04 system, configure it to run without superuser privileges, and verify that the installation is correct.

Key concepts

Before moving on to the commands, it is worth defining the terms — especially if you are working with Docker for the first time.

Container — an isolated process running in user space. A container uses the kernel of the host operating system, but it has its own filesystem, network stack, and environment variables. Unlike a virtual machine, a container does not emulate hardware — it works directly with the kernel, so it starts quickly and uses fewer resources.

Image — a template from which a container is created. An image includes the operating system, the application, and its dependencies, assembled into a layered structure. Images are immutable: each time you run the same image, you get the same container.

Docker Hub — a public image registry. It stores official images for Nginx, PostgreSQL, Node.js, and thousands of others. You can use ready-made images or publish your own.

Docker Engine — the core component of the platform. It consists of the dockerd daemon, a REST API, and the docker command-line client. The Engine is responsible for creating, starting, and stopping containers.

Docker Compose — a tool for defining and running multi-container applications through a YAML file. Instead of starting each container manually with a separate command, you describe the entire infrastructure in one file and bring it up with a single command.

containerd — a low-level container runtime that Docker Engine relies on. Starting with Docker 20+, it is installed as a separate package and managed independently.

How Docker works

Docker uses several Linux kernel mechanisms to isolate processes from one another and from the host system.

Namespaces limit the scope of processes: each container sees only its own filesystem, its own processes, and its own network interface. The cgroups mechanism (control groups) limits resource usage — CPU, memory, and disk I/O. UnionFS is responsible for the layered filesystem of images: each layer is stored separately and reused by different images, which saves disk space.

When you run the docker run command, the client sends a request to the dockerd daemon through a Unix socket. The daemon checks whether the required image exists locally. If not, it downloads it from the registry. After that, containerd creates the container, configures the network interfaces, and starts the process inside the isolated environment.

In practice, this means that an application running in a container is unaware of neighboring containers and cannot accidentally affect them. At the same time, communication between containers is possible — through Docker virtual networks or explicitly published ports.

System requirements

To install Docker on Ubuntu 26.04 LTS, you will need:

  • 64-bit architecture: amd64, arm64, or armhf
  • At least 2 GB of RAM (4 GB or more is recommended)
  • Internet access to download packages and images
  • A user with sudo privileges

You can check the system architecture with the command:

uname -m

If the output is x86_64, the system is suitable. Also make sure the kernel is up to date:

uname -r

Ubuntu 26.04 ships with kernel 6.14, which is fully compatible with current Docker versions.

Step-by-step Docker installation

Step 1. Remove outdated versions

If older Docker versions or compatible packages from Ubuntu’s official repository are already installed on the machine, they should be removed. Packages named docker.io, docker-compose, or containerd conflict with the official Docker Inc. packages.

for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove -y $pkg done

Configuration files and data are not removed. If you need a clean installation without keeping data from previous containers, additionally run:

sudo rm -rf /var/lib/docker sudo rm -rf /var/lib/containerd

On a fresh system, you can skip this step.

Step 2. Update the package database and install dependencies

First, update the package list:

sudo apt-get update

Then install the packages needed to work with HTTPS repositories and GPG keys:

sudo apt-get install -y \ ca-certificates \ curl \ gnupg \ lsb-release

These packages are usually already present in Ubuntu 26.04, but installing them explicitly guarantees they are available.

Step 3. Add the Docker GPG key

Docker distributes signed packages. To let APT verify their authenticity, you need to add the repository GPG key:

sudo install -m 0755 -d /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg |
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

sudo chmod a+r /etc/apt/keyrings/docker.gpg

The key is saved in /etc/apt/keyrings/ — the standard location for third-party repository keys starting with Ubuntu 22.04.

Step 4. Add the official Docker repository

Add the Docker repository to the list of APT sources:

echo
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg]
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 command automatically determines the distribution codename through the VERSION_CODENAME variable. For Ubuntu 26.04, this will be quokka. If Docker has not yet added explicit support for this release, APT may fall back to the nearest supported one — in that case, the current packages will still be installed.

Update the package index so APT sees the new repository:

sudo apt-get update

Step 5. Install Docker Engine

Install Docker Engine together with the accompanying components:

sudo apt-get install -y
docker-ce
docker-ce-cli
containerd.io
docker-buildx-plugin
docker-compose-plugin

What is included in this set:

  • docker-ce — Docker Engine itself (Community Edition)
  • docker-ce-cli — the command-line client
  • containerd.io — the container runtime
  • docker-buildx-plugin — an advanced image-building tool with multi-platform support
  • docker-compose-plugin — Docker Compose v2, integrated as a CLI plugin

Step 6. Start and enable the Docker service at boot

After installation, the Docker daemon must be started and added to startup so it runs after every system reboot:

sudo systemctl enable docker
sudo systemctl start docker

Check the status:

sudo systemctl status docker

The expected output contains the line Active: active (running). If the service does not start, check the journal:

sudo journalctl -u docker --no-pager -n 50

Step 7. Verify the installation

Run the hello-world test container — this is the fastest way to make sure Docker is working correctly:

sudo docker run hello-world

Docker will download the minimal image from Docker Hub and start a container that outputs the message:

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:

The Docker client contacted the Docker daemon.
The Docker daemon pulled the "hello-world" image from the Docker Hub.
The Docker daemon created a new container from that image...
The Docker daemon streamed that output to the Docker client...

The installation was successful. Now you can configure access without sudo.

Step 8. Using Docker without sudo

By default, interacting with the Docker daemon requires superuser privileges because the Unix socket /var/run/docker.sock belongs to the docker group. Add your user to that group:

sudo usermod -aG docker $USER

For the change to take effect, you need to log out and log back in, or apply the group to the current session:

newgrp docker

Check that Docker works without sudo:

docker run hello-world

It is important to understand: users in the docker group effectively get privileges comparable to root. Add only trusted users to the group. On production servers, this step should be considered separately.

Step 9. Verify Docker Compose

Docker Compose v2 is installed as a CLI plugin and is invoked with docker compose (without a hyphen):

docker compose version

Example output:

Docker Compose version v2.27.0

The version may differ — that is normal. If you need compatibility with older scripts that call docker-compose with a hyphen, you can create a symbolic link:

sudo ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/local/bin/docker-compose

Practical example: running Nginx in a container

To make sure everything is working properly, let’s run a simple Nginx web server. This is a good way to check not only the Docker installation, but also port forwarding between the container and the host.

docker run -d -p 8080:80 --name test-nginx nginx:alpine

Let’s break down the flags:

  • -d — run in detached (background) mode
  • -p 8080:80 — map host port 8080 to container port 80
  • --name test-nginx — assign a name to the container for easier management
  • nginx:alpine — an Alpine Linux-based image, minimal in size

Check that the container is running:

docker ps

Open a browser or make a request:

curl http://localhost:8080

The standard Nginx welcome page should be returned. Stop and remove the test container:

docker stop test-nginx
docker rm test-nginx

Useful commands for everyday work

After installing Docker, it is useful to get familiar with a few basic commands right away — they are needed all the time.

Command What it does
docker ps Shows running containers
docker ps -a All containers, including stopped ones
docker images List of downloaded images
docker pull Download an image from Docker Hub
docker logs View container logs
docker exec -it bash Enter a running container
docker stop Stop a container
docker rm Remove a stopped container
docker rmi Remove an image
docker system prune Clean up unused resources

Possible installation issues

Repository not found or unavailable

If the apt-get update command returns an error after adding the Docker repository, check the distribution codename manually:

. /etc/os-release && echo $VERSION_CODENAME

If Docker has not yet added support for Ubuntu 26.04 in its repository, replace $VERSION_CODENAME with noble (Ubuntu 24.04) manually in the /etc/apt/sources.list.d/docker.list file. The packages will still work correctly — Docker Engine is not tied to specific Ubuntu versions in terms of dependencies.

The service does not start after installation

This sometimes happens because of a conflict with an already running containerd or another runtime implementation. Check the status:

sudo systemctl status containerd
sudo systemctl restart docker

If the error repeats, view the full journal:

sudo journalctl -u docker -f

Permission denied when working without sudo

If commands still require sudo after adding the user to the docker group, the session probably has not been refreshed. Log out completely and log back in, or apply the group with the newgrp docker command. You can check the user’s current groups with the groups command.

What’s next

After successfully installing Docker Engine, there are several obvious directions for further work. If you plan to deploy multi-service applications, start with Docker Compose: define the services in a docker-compose.yml file and manage them as a single unit. To work with your own images, you need to learn Dockerfile — the file that describes image building step by step.

If the task is managing a container cluster across multiple machines, the next step is Docker Swarm or Kubernetes. Both tools use Docker images, so basic Docker knowledge will only help here.

On a production server, it is also worth configuring container log rotation. By default, Docker writes logs to JSON files without size limits, which can eventually fill up the disk. Add the following configuration to /etc/docker/daemon.json:

{
"log-driver": "json-file",
"log-opts": {
"max-size": "50m",
"max-file": "3"
}
}

After changing the file, restart the daemon:

sudo systemctl restart docker

Summary

We installed Docker Engine and Docker Compose on Ubuntu 26.04 LTS from Docker’s official repository, started and verified the daemon, configured access without sudo, and tested running containers. The entire process takes about ten minutes on a clean system.

Docker from the official repository is preferable to Ubuntu’s docker.io package because it is always up to date: updates are released faster, and the engine version is not tied to the distribution’s release cycle. This is important for production systems.

Vote:
4 out of 5
Аverage rating : 4.5
Rated by: 2
1101 CT Amsterdam The Netherlands, Herikerbergweg 292
+31 20 262-58-98
700 300
ITGLOBAL.COM NL
700 300

You might also like...

We use cookies to make your experience on the Serverspace better. By continuing to browse our website, you agree to our
Use of Cookies and Privacy Policy.