How to Install Docker on Ubuntu 26.4

6 min read • 1,198 words
Introduction
If you’re looking for a straightforward way to containerize your applications on the latest Ubuntu release, this guide will show you how to install Docker on Ubuntu 26.4 using the official Docker repository. While Ubuntu’s default repositories do include a version of Docker, using the official source ensures you get the most up-to-date features, security patches, and performance improvements directly from the Docker team. The process is clean, reliable, and takes just a few minutes from start to finish.
Before you begin, it’s essential to prepare your system correctly. First, update your existing package list with the command sudo apt update to ensure all your current software indexes are current. Next, you’ll need to install a few prerequisite packages—such as apt-transport-https, ca-certificates, and curl—to enable secure downloads over HTTPS. After that, you’ll add Docker’s official GPG key using curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg, which verifies that the packages you download are authentic. Finally, you’ll install the Docker engine itself with sudo apt install docker-ce to get your environment ready for running containers.
Step-by-Step Tutorial

Step 1: Update System Packages
- Open your terminal. You can do this by searching for “Terminal” in your applications menu or by using the shortcut
Ctrl + Alt + T. - Before proceeding, ensure you have a stable internet connection, as the update process requires downloading package information from online repositories.
- Run the following command to update the package list and upgrade all installed packages:
- Wait for the process to complete. The terminal will display messages indicating the progress of the updates.
- After the updates are finished, check for any held packages that may need attention by running:
- If you are using an older version of Ubuntu, you may need to use
apt-getinstead ofapt:
sudo apt update && sudo apt upgrade -y
sudo apt-mark showhold
sudo apt-get update && sudo apt-get upgrade -y
Once completed, your system packages should be updated successfully, ensuring a smoother installation process for Docker.

Step 2: Install Required Dependencies
- Open your terminal on Ubuntu.
- Update your package index to ensure you have the latest information about available packages by running the following command:
sudo apt update - Install the required dependencies by executing the command below. This will install essential packages needed for Docker:
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y - Verify that the packages were installed successfully by checking the installed packages with:
dpkg -l
It is important to note that this step is crucial for adding Docker’s official GPG key, which ensures the integrity and authenticity of the Docker packages. If you are using an older version of Ubuntu, consider using apt-get instead of apt for compatibility.

Step 3: Add Docker’s Official GPG Key
Docker signs its packages with a GPG key to ensure authenticity and integrity. Adding this key to your system allows apt to verify that the Docker packages you install come directly from Docker and have not been tampered with. Follow these steps carefully:
-
Verify
curlis installed (recommended):If you skipped Step 2 or are unsure, check that
curlis available. Run:which curlIf it returns a path (e.g.,
/usr/bin/curl), you are ready. If not, install it with:sudo apt update && sudo apt install curl -y -
Download and add the Docker GPG key:
Execute the following command exactly as shown. It fetches the official Docker GPG key from Docker’s servers and adds it to your system’s trusted keyring:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -Here’s what each flag does:
-f(fail silently on server errors),-s(silent mode),-S(show errors), and-L(follow redirects). The pipe (|) sends the downloaded key directly toapt-key add -, which reads it from standard input. -
Confirm the key was added successfully:
After the command completes, you should see no error output. To verify that the key is now present, list all trusted keys:
apt-key listLook for an entry mentioning “Docker” or a key ID ending in
8D81803C0EBFCD88. If you see it, the key is correctly installed.
Tips: Always run apt-key list right after adding the key to catch any typo in the URL. If the key does not appear, double-check the command for trailing spaces or missing characters.
Warnings: This command must be typed exactly as provided. A single typo in the URL or the apt-key syntax can result in a failed import or, worse, adding an untrusted key. Never use a different source for the GPG key — only use the official Docker URL shown above. Also note that apt-key is deprecated in newer Ubuntu versions, but it remains functional for this purpose; a proper repository setup will be configured in the next step using this key.

Step 4: Install Docker CE
-
First, add the Docker repository to your system by running the following command:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" -
Next, update your package index to include the new Docker packages:
sudo apt update -
Now, install Docker Community Edition (CE) with the following command:
sudo apt install docker-ce -
After the installation completes, check if Docker is running by executing:
systemctl status docker -
For easier management, consider adding your user to the ‘docker’ group:
sudo usermod -aG docker $USER
Make sure to check for any conflicting installations of Docker and ensure you have sufficient permissions to install software on your system. Once completed, Docker CE should be installed and running smoothly.
Conclusion
In this guide, we have walked through the steps on how to install Docker on Ubuntu 26.4. By following the outlined procedures, you can successfully set up Docker on your system, enabling you to create, manage, and deploy containers efficiently. With Docker, you can streamline your development and deployment processes, making it an invaluable tool for developers and system administrators alike.
Remember to keep your Docker installation updated and refer to the official Docker documentation for any advanced configurations or troubleshooting. Now that you know how to install Docker on Ubuntu 26.4, you can start exploring the vast ecosystem of Docker images and containers to enhance your projects and workflows.
Frequently Asked Questions
What is Docker?
Docker is an open-source platform that automates the deployment, scaling, and management of applications using containerization. It allows developers to package applications and their dependencies into containers, ensuring consistency across different environments.
How do I install Docker on Ubuntu 26.4?
To install Docker on Ubuntu 26.4, you can follow these steps:
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce
After installation, you can verify that Docker is running by executing sudo systemctl status docker.
Do I need to uninstall old versions of Docker?
If you have an older version of Docker installed, it is recommended to uninstall it before installing the latest version. You can do this using the command sudo apt remove docker docker-engine docker.io containerd runc.
Related Articles
Stay ahead of the curve
Weekly tutorials, AI tools, and startup tech news in your inbox.
