Brieflyn
Navigation Menu
Home › Tutorials & How-To › How to Install Docker on Ubuntu 24.04: 2026 Guide

How to Install Docker on Ubuntu 24.04: 2026 Guide

How to Install Docker on Ubuntu 24.04: 2026 Guide
By Brieflyn Editorial Team • Published: August 07, 2026 • 6 min read (1,146 words) • 31 views
Learn how to install docker on ubuntu 24.04 in 2026 with the official Docker CE repo, secure rootless mode, and step‑by‑step commands for sysadmins today.

How to install Docker on Ubuntu 24.04 starts with a clean LTS install, a few apt commands, and a pinch of security hardening. By the end of this article you will have Docker Engine, containerd, BuildKit, and the Compose V2 plugin running as a first‑class citizen on Ubuntu 24.04 (codenamed Noble Numbat). The steps are reproducible on laptops, Raspberry Pi 4, or cloud VMs, and they respect Ubuntu’s new /etc/apt/keyrings/ layout.

how to install docker on ubuntu 24.04 tutorial diagram

Overview & Quick Answer – how to install docker on ubuntu 24.04

What you’ll get by the end

  • Docker Engine 23.x, containerd 1.7, BuildKit, and Compose V2 installed from Docker’s official APT repo.
  • A non‑root user capable of running docker commands (optional rootless mode).
  • Verification steps using the hello‑world image and a basic docker compose file.

One‑liner

Run a single apt line to pull docker-ce, docker-ce-cli, containerd.io, docker-buildx-plugin, and docker-compose-plugin – then test with sudo docker run hello-world.

Why Docker on Ubuntu 24.04 Matters in 2026

Shipping containers and cranes at Hamburg port showcasing global trade.
Photo by Wolfgang Weiser via Pexels. Docker On Ubuntu 2404 Technology.

Modern container workloads

Ubuntu 24.04 ships with cgroups v2 and a unified systemd hierarchy, which Docker has fully embraced. This alignment reduces kernel‑level overhead, yielding a typical CPU footprint of 2‑4 % on idle and 0.2 GB RAM for the daemon. The same stack powers the majority of CI/CD pipelines, edge AI services, and micro‑service architectures in 2026.

Security updates & compliance

Docker’s official repository pushes security patches within 48 hours of CVE disclosure. Ubuntu’s LTS guarantee (2024‑2029) means you stay compliant without hunting third‑party repos. The daemon respects AppArmor profiles out‑of‑the‑box, and you can enable user namespaces for added isolation.

Compatibility with Kubernetes and CI/CD

Kubernetes 1.30, released earlier this year, still uses the Docker Engine’s containerd shim for legacy workloads. Installing Docker from the upstream repo guarantees that kubectl and helm find the expected socket at /var/run/docker.sock. Most CI runners (GitHub Actions, GitLab CI) also default to Docker CE for build‑and‑test stages.

Prerequisites & System Requirements – how to install docker on ubuntu 24.04

Supported Ubuntu 24.04 LTS releases

  • Desktop edition (GNOME 44) – minimum 4 GB RAM, 2 CPU cores.
  • Server edition – 2 CPU cores, 2 GB RAM (Docker daemon itself uses ≈150 MB).

Hardware & kernel version

Any kernel ≥ 6.5 (the default in Noble) works. For ARM64 boards (e.g., Raspberry Pi 4 64‑bit) replace amd64 with arm64 in the repository line.

Network & firewall settings

Docker creates a docker0 bridge (default subnet 172.17.0.0/16). If you run UFW, allow traffic to this bridge:

sudo ufw allow in on docker0
sudo ufw reload

Choosing the Right Docker Installation Method

Shipping containers and cranes at Hamburg port showcasing global trade.
Photo by Wolfgang Weiser via Pexels. Docker On Ubuntu 2404 Concept.

Official Docker CE repo vs. Ubuntu repos

The docker.io package in Ubuntu’s archive lags behind upstream by several months and bundles an older containerd. The official CE repo delivers the latest Engine, BuildKit, and Compose V2 together, keeping you on the same release cadence as Docker Hub.

Docker Desktop for Linux – pros and cons

Docker Desktop runs a lightweight Alpine VM via QEMU/KVM. It adds a system‑tray UI, integrated Kubernetes, and extensions like Docker Scout. The trade‑off is an extra 1–2 GB RAM consumption and a second network namespace. For headless servers, the overhead is unnecessary.

Rootless Docker vs. privileged mode

Rootless mode launches the daemon under an unprivileged user namespace, eliminating the need for the docker group. Performance impact is modest: docker run latency rises ~5 ms, and CPU usage stays under 5 % for typical workloads. Privileged mode (daemon as root) is still the default for single‑user desktops.

Step‑by‑Step: Installing Docker Engine from Official Repo

Uninstall old docker.io packages

sudo apt purge -y docker.io docker-doc docker-compose-plugin
sudo apt autoremove -y

Set up GPG key and repository

sudo mkdir -p /etc/apt/keyrings
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

Install docker‑ce, docker‑ce‑cli, containerd.io

sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io \
 docker-buildx-plugin docker-compose-plugin

Verify installation with hello‑world

sudo systemctl enable --now docker
sudo docker run --rm hello-world

The output should begin with “Hello from Docker!” confirming that the daemon, CLI, and networking are healthy.

Enabling and Configuring Docker Compose V2

Installing compose plugin

The docker-compose-plugin package ships the V2 binary as docker compose. No separate binary is needed.

Using docker compose up

cat > docker-compose.yml <<'EOF'
version: "3.9"
services:
 web:
 image: nginx:alpine
 ports:
 - "8080:80"
EOF

docker compose up -d

Compose file best practices

  • Pin image tags (e.g., nginx:1.25-alpine) to avoid accidental upgrades.
  • Define resource limits with deploy.resources.limits for production.
  • Store secrets in Docker Swarm/Kubernetes or use docker secret instead of env vars.

Switching between compose v1 & v2

If you still need the legacy docker‑compose binary, install it via pip3 install docker-compose. The V2 plugin will take precedence when both are present.

Rootless Docker vs. Docker Group: Security Trade‑offs

What rootless mode does

Rootless Docker runs the daemon in a user namespace, mapping the host UID range to a high, unprivileged range (65536‑100000). This prevents a compromised container from gaining root on the host.

Adding user to docker group – risks

Members of the docker group can bind‑mount any host directory into a container, effectively granting root. On multi‑tenant servers, that is a serious privilege escalation vector.

Configuring rootless Docker

sudo apt install -y docker-ce-rootless-extras
dockerd-rootless-setuptool.sh install

After installation, log out and back in; the daemon will start automatically under your user.

Performance impact

Benchmarks on a 4‑core, 8 GB VM show a 3‑5 % increase in container start‑up time versus privileged mode. For most development workloads the trade‑off is acceptable, especially when security policies demand it.

Common Pitfalls & Troubleshooting Tips

Conflicting packages & apt errors

If you see “Unable to locate package docker‑ce”, double‑check that /etc/apt/sources.list.d/docker.list references the correct VERSION_CODENAME (noble). Run sudo apt update again.

Permissions & socket access

Running docker ps without sudo after adding yourself to the docker group requires a new login session. The shortcut newgrp docker refreshes group membership in the current shell.

SELinux/AppArmor issues

Ubuntu ships with AppArmor profiles for Docker. If a container fails to start, inspect journalctl -u docker for “apparmor” denials and adjust the profile or disable it with sudo aa-disable /etc/apparmor.d/docker.

Network bridge problems

When docker0 collides with an existing subnet, edit /etc/docker/daemon.json:

{
 "bip": "172.31.0.1/16"
}

Who Should Use This Guide? (Persona Table)

Target PersonaRecommended OptionKey Reason & Real‑World Benefit
Developer on a personal laptopDocker Desktop (GUI) + rootless modeIntegrated UI, easy Kubernetes toggle, modest RAM overhead (<2 GB) suitable for day‑to‑day coding.
DevOps on a production serverDocker Engine from official repo (privileged)Lowest resource footprint, predictable startup, seamless integration with CI/CD pipelines.
Sysadmin managing shared hostsRootless Docker + sudo‑only accessEliminates the “docker” group privilege escalation risk while keeping performance acceptable.
Cloud‑native architectDocker Engine + Compose V2 + Kubernetes‑ready configurationProvides consistent runtime across on‑prem, edge, and cloud, ready for migration to K8s.

Final Verdict & Next Steps – how to install docker on ubuntu 24.04

Summary of benefits

Installing Docker from the official repository gives you the freshest Engine, a lean containerd runtime, and the Compose V2 plugin in a single transaction. The daemon’s idle RAM stays under 200 MB, and CPU load is negligible, making it suitable for everything from a 2 GB VM to a 32‑core cloud instance.

Recommended next learning steps

  1. Explore multi‑stage builds with docker buildx to shrink image size.
  2. Secure your daemon: enable user namespaces and configure /etc/docker/daemon.json log rotation.
  3. Deploy a real workload, e.g., Nextcloud All‑in‑One (docker run -d -p 8443:8443 ...), to see volume persistence in action.
  4. Integrate Docker with GitHub Actions or GitLab CI for automated testing.

Resources & community links

Following this step‑by‑step tutorial ensures you have a production‑ready container runtime on Ubuntu 24.04, with the flexibility to scale from a single developer laptop to a multi‑node Kubernetes cluster.

Frequently Asked Questions

'docker.io' is a transitional meta-package maintained in Ubuntu's own repositories; it often lags behind the upstream release and bundles an older containerd. 'docker-ce' (Docker Community Edition) comes directly from Docker Inc.'s APT repository at download.docker.com/linux/ubuntu, is updated in lockstep with upstream, and is what Docker officially supports on 24.04.

No comments yet. Be the first to share your technical feedback!

Leave Technical Feedback / Discussion

B

Brieflyn Editorial Team

Senior cybersecurity researchers, DevOps engineers, and technical editors at Brieflyn.

EXPERTISE: CYBERSECURITY, CLOUD INFRASTRUCTURE, & SOFTWARE SYSTEMS

Related Guides & Documentation