How To

Install Docker on Ubuntu 26.04 Like a Pro

Docker has become a core tool in modern DevOps and cloud-native development. If you want to Install Docker on Ubuntu systems for containerized applications, Ubuntu 26.04 provides a reliable and stable platform for deployment.

Docker allows developers to package applications along with their dependencies into portable containers. This ensures the software behaves consistently across development, staging, and production environments.

In this guide, you’ll learn how to install Docker on Ubuntu 26.04 using Docker’s official repository, verify the installation, and configure Docker for daily use.

Why Install Docker on Ubuntu Systems?

Docker simplifies software deployment and improves development workflows. Instead of configuring environments manually, developers can launch isolated containers in seconds.

Ubuntu 26.04 includes Docker packages in its repositories, but they may not always provide the latest stable release. Using Docker’s official repository ensures you receive recent updates, performance improvements, and security patches.

Before starting, remove older Docker-related packages to avoid conflicts:

sudo apt remove docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc

Install Docker on Ubuntu Using Official Repository

First, update the package list and install required dependencies:

sudo apt updatesudo apt install ca-certificates curl

Next, create the keyring directory and import Docker’s official GPG key:

sudo install -m 0755 -d /etc/apt/keyringssudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.ascsudo chmod a+r /etc/apt/keyrings/docker.asc

Now add Docker’s APT repository to Ubuntu:

sudo tee /etc/apt/sources.list.d/docker.sources <<EOFTypes: debURIs: https://download.docker.com/linux/ubuntuSuites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")Components: stableArchitectures: $(dpkg --print-architecture)Signed-By: /etc/apt/keyrings/docker.ascEOF

After enabling the repository, install Docker Engine and related components:

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

Verify Docker is Installed on Ubuntu

Once installation finishes, Docker usually starts automatically. Verify the service status using:

sudo systemctl status docker

You can also check the installed Docker version:

sudo docker version

To confirm Docker is functioning correctly, run the test container:

sudo docker run hello-world

If everything is configured properly, Docker downloads the image and displays a welcome message.

Run Docker Without sudo

By default, Docker commands require elevated privileges. However, adding your account to the Docker group allows easier access.

Run the following command:

sudo usermod -aG docker $USER

Then apply the changes by logging out and back in, or execute:

newgrp docker

You can now run Docker commands without sudo privileges.

Updating and Managing Docker

Keeping Docker updated is important for security and compatibility. Update packages regularly with:

sudo apt updatesudo apt upgrade

If needed, you can also install a specific Docker release instead of the latest version by listing available packages through APT.

Conclusion

Learning how to Install Docker on Ubuntu servers properly is essential for developers, DevOps engineers, and system administrators working with containerized applications. Ubuntu 26.04 combined with Docker provides a stable and scalable environment for building, testing, and deploying workloads efficiently.

After installation, you can begin exploring Docker Compose, container orchestration, and advanced networking for production-ready deployments.

Cyber Defence

Recent Posts

ss Command in Linux: Display Socket Statistics and Connections

The ss command in Linux lists open sockets and active network connections. It replaced the deprecated netstat command and…

12 hours ago

ftp Command in Linux: Connect to Servers and Transfer Files

The ftp command in Linux connects to a remote FTP server and transfers files. FTP transmits everything…

12 hours ago

lsmod Command in Linux: List and Inspect Kernel Modules

The lsmod command in Linux lists all currently loaded kernel modules. It reads /proc/modules — a virtual file maintained…

13 hours ago

rename Command in Linux: Batch Rename Files with Perl Regex

The rename command in Linux renames multiple files at once using Perl regular expressions. Unlike mv, which handles…

13 hours ago

pgrep Command in Linux: Find and Filter Running Processes

The pgrep command in Linux finds the PIDs of running processes based on a name or other…

1 day ago

unlink Command in Linux: Remove a Single File or Symlink

The unlink command in Linux removes a single file by deleting its directory entry. It is a…

1 day ago