Docker is a powerful platform that allows developers to build, deploy, and run applications in isolated environments called containers. Ubuntu 24.04 LTS, being a long-term support release, is a popular choice for setting up Docker. Here’s a step-by-step guide to installing Docker on Ubuntu 24.04 LTS.
Prerequisites
Before you start, make sure you have:
- Ubuntu 24.04 LTS installed: You can verify your Ubuntu version with
lsb_release -a
. - Sudo privileges: You need administrative access to install Docker.
- A working internet connection: Docker installation requires downloading packages from the internet.
Commands
sudo apt update
sudo apt install apt-transport-https curl
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg –dearmor -o /etc/apt/keyrings/docker.gpg
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
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl is-active docker
sudo usermod -aG docker ${USER}
sudo apt purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras