Docker is a powerful open-source containerization platform that allows developers to build, test, and deploy applications as lightweight, portable containers. These containers include everything an application needs to run dependencies, libraries, and runtime, while staying isolated from the host system.
Because of its speed, portability, and scalability, Docker has become a core tool in modern software development and DevOps pipelines.
In this tutorial, we’ll walk you through installing the latest version of Docker on Ubuntu.
At the time of writing, the official Docker repository provides packages for:
We’ll use Docker’s official repository to ensure you always get the latest stable release.
Update the package index and install essential dependencies for adding a secure repository:
sudo apt update
sudo apt install ca-certificates curl gnupg -yCreate a keyring directory and import the Docker GPG key:
sudo mkdir -p /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.ascAdd Docker’s official repository to your system:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list$(lsb_release -cs) prints your Ubuntu codename (e.g., jammy for 22.04).
Update the package list:
sudo apt updateTo install the latest version of Docker CE (Community Edition), run:
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -yIf you want a specific Docker version, first list all available versions:
apt list -a docker-ceExample output:
docker-ce/jammy 5:26.0.0-1~ubuntu.22.04~jammy amd64
docker-ce/jammy 5:25.0.5-1~ubuntu.22.04~jammy amd64
...Install a chosen version by specifying it:
DOCKER_VERSION=5:24.0.7-1~ubuntu.23.10~mantic
sudo apt install docker-ce=$DOCKER_VERSION docker-ce-cli=$DOCKER_VERSION containerd.io docker-buildx-plugin docker-compose-plugin -yCheck Docker’s service status:
sudo systemctl status dockerRun the test container:
docker run hello-worldIf successful, Docker will print “Hello from Docker” and exit.
sudoBy default, only root or sudo users can run Docker. To allow your user account to run Docker:
sudo usermod -aG docker $USERLog out and log back in, then test:
docker run hello-worldsudo apt update && sudo apt upgrade -ysudo apt-mark hold docker-ceYou’ve successfully installed Docker on Ubuntu. 🎉
Docker makes it easy to build, test, and deploy applications consistently across environments. From simple test containers to production-grade deployments, Docker is a must-have tool in your DevOps toolkit.
Read more : Uninstall docker
General Working of a Web Application Firewall (WAF) A Web Application Firewall (WAF) acts as…
How to Send POST Requests Using curl in Linux If you work with APIs, servers,…
If you are a Linux user, you have probably seen commands like chmod 777 while…
Vim and Vi are among the most powerful text editors in the Linux world. They…
Working with compressed files is a common task for any Linux user. Whether you are…
In the digital era, an email address can reveal much more than just a contact…