Install Docker Container Engine and Compose V2 with official repositories, security groups, and autostart
By following this guide, you will have official Docker Community Edition and Docker Compose V2 installed and configured on Ubuntu 24.04. You will be able to run containers without typing sudo, streamlining local and production microservice workflows.
Spin up an Ubuntu 24.04 instance with instant activation to test this tutorial:
Deploy IndSoft VPSAn Ubuntu 24.04 server with 2 GB RAM minimum. Recommended: IndSoft High-IOPS NVMe VPS.
Clean previous unmaintained packages and install official Docker repository signing keys.
sudo apt remove docker docker-engine docker.io containerd runc
sudo apt update && sudo apt 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.ascSet up the stable repository source list for Ubuntu Noble 24.04.
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] 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 updateInstall the latest Docker daemon, containerd, and Docker Compose plugin.
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -yAdd your non-root user account to the docker usergroup to run containers without sudo.
sudo usermod -aG docker $USER
newgrp dockerRun this quick verification check to confirm your installation is responding properly:
docker run hello-worldQuick resolutions for frequent setup pitfalls and configuration issues.
newgrp docker for the group membership change to take effect.
/etc/apt/sources.list.d/docker.list points to 'noble' release and execute sudo apt update.
sudo journalctl -u docker.service -e to check for conflicting network bridge interfaces.