DevOps & Containers Beginner 10 min

How to Install Docker and Docker Compose on Ubuntu 24.04 LTS

Install Docker Container Engine and Compose V2 with official repositories, security groups, and autostart

IndSoft Cloud Engineering
Reviewed October 2026
Production Verified Commands

Guide Overview & Architecture Outcome

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.

Prerequisites & System Requirements

An Ubuntu 24.04 server with 2 GB RAM minimum. Recommended: IndSoft High-IOPS NVMe VPS.

1

Uninstall Old Docker Packages and Add Official GPG Key

Clean previous unmaintained packages and install official Docker repository signing keys.

bash · step-1-command.sh
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.asc
Expected System Output:
OK
2

Add Docker Repository to Apt Sources

Set up the stable repository source list for Ubuntu Noble 24.04.

bash · step-2-command.sh
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 update
Expected System Output:
Hit:1 https://download.docker.com/linux/ubuntu noble InRelease Reading package lists... Done
3

Install Docker Engine, CLI, and Compose Plugin

Install the latest Docker daemon, containerd, and Docker Compose plugin.

bash · step-3-command.sh
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
Expected System Output:
Setting up docker-ce (5:26.1.1-1~ubuntu.24.04~noble) ... Created symlink /etc/systemd/system/multi-user.target.wants/docker.service
4

Enable Non-Root Execution Permissions

Add your non-root user account to the docker usergroup to run containers without sudo.

bash · step-4-command.sh
sudo usermod -aG docker $USER newgrp docker
Expected System Output:
Membership updated.

Check That It Worked (Verification)

Run this quick verification check to confirm your installation is responding properly:

verify-service.sh
docker run hello-world
Expected Response:
Hello from Docker! This message shows that your installation appears to be working correctly.

Troubleshooting Common Errors

Quick resolutions for frequent setup pitfalls and configuration issues.

Diagnostic Tips
Permission denied while connecting to Docker daemon socket
You must log out and back in or run newgrp docker for the group membership change to take effect.
Apt cannot find docker-ce package
Verify that /etc/apt/sources.list.d/docker.list points to 'noble' release and execute sudo apt update.
Docker daemon fails to start
Inspect systemd logs using sudo journalctl -u docker.service -e to check for conflicting network bridge interfaces.