[How-To] Install Docker Engine
Purpose
The purpose of this document is to explain a full install of docker engine on Ubuntu. When you install the latest version of docker engine, this includes: dockerd (Docker Daemon), docker CLI, Container Runtime (containerd + runc), Docker BuildKit, Networking Stack, Volume Management, and Image Container Storage.
Prerequisites
List of prerequisites:
- Sudo user.
- One of the following Ubuntu versions in VM:
- Ubuntu Oracular 24.10
- Ubuntu Noble (24.04 LTS)
- Ubuntu Jammy 22.04 (LTS)
Instructions: Install Docker with apt Repository
Step 1: Set up Docker's apt repository
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
Step 2: Install the Docker packages
For latest packages:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
For specific versions:
# List the available versions:
apt-cache madison docker-ce | awk '{ print $3 }'
5:28.3.3-1~ubuntu.24.04~noble
5:28.3.2-1~ubuntu.24.04~noble
...
Step 3: Verify Installation
Verify that the installation is successful by running the hello-world
image:
sudo docker run hello-world
Success! You have now installed and started Docker Engine!