Docker lets you package an application and everything it needs into a portable container that runs identically on your laptop, a VPS, or a production cluster. If you manage Linux servers, learning to install Docker Ubuntu 24.04 is one of the highest-leverage skills you can add to your sysadmin toolkit. This guide walks you through the officially recommended method: adding Docker’s own APT repository to Ubuntu 24.04 (Noble Numbat), installing Docker Engine with the Compose and Buildx plugins, running your first container, and fixing the most common errors along the way.

Prerequisites
- A server or VM running Ubuntu 24.04 LTS (64-bit). You can confirm with
lsb_release -a, which should showRelease: 24.04andCodename: noble. - A non-root user with
sudoprivileges. If you only have root access over SSH, see our guide on how to SSH into a Linux server and create a regular user first. - At least 2 GB of RAM and 10 GB of free disk space for comfortable container work.
- Internet access so the server can reach Docker’s package repository.
Step 1: Remove Conflicting Docker Packages
Ubuntu’s default repositories ship older, unofficial Docker packages (docker.io, docker-compose) that conflict with the official ones. Before you install Docker on Ubuntu 24.04, remove any of them that might be present:
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
It is fine if this reports that nothing was installed. Also note that images, containers, volumes, and networks stored in /var/lib/docker/ are preserved by this step — only the packages are removed.
Step 2: Add Docker’s Official APT Repository
The safest way to install Docker on Ubuntu 24.04 is from Docker’s official repository, which always carries the latest stable Engine. First, install the tools needed to download and verify the repository’s signing key:
sudo apt-get update
sudo apt-get install ca-certificates curl
Next, create the APT keyrings directory and download Docker’s official GPG key into it:
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
Now add the repository. This command detects your Ubuntu codename (noble on 24.04) and CPU architecture automatically:
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-get update
If apt-get update completes without GPG or 404 errors, the repository is correctly registered. If you are still running the previous LTS release, our guide to install Docker on Ubuntu 22.04 covers the same flow for Jammy.
Step 3: Install Docker Engine on Ubuntu 24.04
With the repository in place, install Docker Engine, the CLI, the containerd runtime, and the Buildx and Compose plugins in one command:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
This installs:
docker-ce— the Docker Engine daemondocker-ce-cli— thedockercommand-line clientcontainerd.io— the container runtimedocker-buildx-plugin— extended image-building capabilitiesdocker-compose-plugin— the moderndocker compose(v2) command
Step 4: Verify the Installation and Run the Hello-World Container
Check that the Docker service is running and enabled:
sudo systemctl status docker --no-pager
sudo systemctl enable docker
You should see Active: active (running). Now run the official test image — Docker will download it and print a confirmation message:
sudo docker run hello-world
If the output ends with “This message shows that your installation appears to be working correctly”, you have successfully completed the install Docker Ubuntu 24.04 procedure.
Step 5: Manage Docker Without sudo (Optional but Recommended)
By default, the docker command requires root privileges. Add your user to the docker group so you can run containers without typing sudo every time:
sudo usermod -aG docker $USER
newgrp docker
The newgrp docker command activates the new group in your current shell; otherwise, log out and log back in. Verify it works:
docker run hello-world
Security note: members of the docker group can effectively gain root on the host (for example, by mounting / into a container), so only add trusted users. On internet-facing servers, also consider locking down published ports with a firewall — see our guide to configure UFW on Ubuntu.
Step 6: Run Your First Real Container
Let’s run an Nginx web server in a detached container and publish its port 80 to host port 8080:
docker run -d -p 8080:80 --name my-nginx --restart unless-stopped nginx
Check that it is running and test it:
docker ps
curl -I http://localhost:8080
You should see Nginx’s default welcome page headers. When you are done experimenting, stop and remove the container:
docker stop my-nginx
docker rm my-nginx
A Quick Docker Compose Example
For multi-container apps, the Compose plugin is invaluable. Create a minimal project:
mkdir -p ~/compose-demo && cd ~/compose-demo
cat > docker-compose.yml <<'EOF'
services:
web:
image: nginx:alpine
ports:
- "8080:80"
restart: unless-stopped
EOF
docker compose up -d
docker compose ps
docker compose down
Troubleshooting: Common Errors When You Install Docker on Ubuntu 24.04
1. "permission denied while trying to connect to the Docker daemon"
This means your user is not in the docker group in the current shell. Re-run sudo usermod -aG docker $USER, then log out and back in (or use newgrp docker). Until then, prefix commands with sudo.
2. GPG error: "The following signatures couldn't be verified" during apt update
The key file is missing or unreadable. Re-download it and ensure it is world-readable:
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
sudo apt-get update
3. 404 Not Found for https://download.docker.com/linux/ubuntu noble
This happens when the codename in /etc/apt/sources.list.d/docker.list does not match your release (for example, after an OS upgrade). Verify with lsb_release -cs — it must print noble on Ubuntu 24.04 — then regenerate the docker.list line from Step 2.
4. "Cannot connect to the Docker daemon" / service fails to start
Check the service state and logs:
sudo systemctl status docker --no-pager
sudo journalctl -u docker --no-pager -n 50
Common causes are a corrupted /var/lib/docker after an interrupted install (stop Docker, move the directory aside, and restart) or a conflicting containerd installed from Ubuntu's repositories (remove it and reinstall from Docker's repo).
Conclusion
You now know how to install Docker Ubuntu 24.04 from the official repository, verify the installation, run containers without sudo, and orchestrate a simple service with Docker Compose. Because the packages come from Docker's own APT source, future security updates arrive with a plain sudo apt-get upgrade. From here, good next steps are learning to write your own Dockerfiles, manage persistent data with volumes, and put a reverse proxy such as Nginx in front of your containers. For the full reference behind every command used here, see the official Docker Engine installation guide for Ubuntu.