Docker has transformed how developers build, ship, and run applications. If you’re setting up a new Ubuntu 24.04 server, installing Docker is one of the first steps to a modern, containerized infrastructure. According to the 2024 Stack Overflow Developer Survey, over 57% of developers use Docker as part of their daily workflow — making it the most widely adopted container platform in the world. Whether you’re deploying a web app, running a database, or experimenting with microservices, this guide will walk you through exactly how to install Docker on Ubuntu 24.04 step by step, the right way.

What Is Docker and Why Ubuntu 24.04?
Docker is an open-source containerization platform that allows you to package applications and their dependencies into isolated units called containers. Unlike virtual machines, containers share the host OS kernel, making them lightweight, fast, and highly portable.
Ubuntu 24.04 LTS (Noble Numbat) is the latest long-term support release from Canonical, with official support until 2029. It ships with an updated Linux kernel 6.8, improved security defaults, and better hardware compatibility — all of which make it an excellent foundation for running Docker in production.
Docker Engine vs Docker Desktop
On Ubuntu servers, you will install Docker Engine — the CLI-driven, headless version designed for server workloads. Docker Desktop is a GUI application for local development on Mac or Windows. For a VPS or cloud server running Ubuntu 24.04, Docker Engine is always the correct choice. It includes the Docker daemon (dockerd), the CLI client (docker), and Docker Compose as a plugin.
Why Installing Docker Correctly Matters

Many tutorials instruct users to install Docker from Ubuntu’s default apt repositories using apt install docker.io. While this works, it installs an older community-maintained version that often lags several releases behind Docker’s official builds. Installing from Docker’s official repository ensures you get:
- The latest stable Docker Engine release with security patches
- Docker Compose V2 as a native plugin (not the deprecated standalone binary)
- Automatic updates via apt when Docker publishes new versions
- Official support from Docker Inc. for enterprise troubleshooting
- Compatibility with modern features like BuildKit, containerd snapshotter, and Swarm mode
For anyone running production workloads or following DevOps best practices, the official installation method is non-negotiable. You can explore more server setup guides in our How-To section.
How to Install Docker on Ubuntu 24.04: Step-by-Step Guide
Follow these steps carefully. Each command is tested on a clean Ubuntu 24.04 LTS installation.
Step 1 — Update your system packages
Ensure your package lists and installed packages are current before adding new repositories.
sudo apt update && sudo apt upgrade -y
Step 2 — Install prerequisite packages
Install ca-certificates, curl, and gnupg. These are needed to securely download Docker’s GPG key and repository.
sudo apt install -y ca-certificates curl gnupg
Step 3 — Add Docker’s official GPG key
Create the keyrings directory, download the GPG key, then set the correct permissions.
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
Step 4 — Add the Docker apt repository
Register Docker’s stable repository so apt can install and update Docker Engine from Docker’s official source.
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
Step 5 — Update apt and install Docker Engine
Refresh the package index to include the new Docker repository, then install the full Docker stack.
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Step 6 — Verify the installation
Confirm Docker is running correctly. You should see a “Hello from Docker!” message confirming the engine is working.
sudo docker run hello-world
Step 7 — Add your user to the docker group (optional but recommended)
To run Docker without sudo, add your user to the docker group, then log out and back in. This is important for developer workstations but optional on dedicated servers where root access is managed differently.
sudo usermod -aG docker $USER
Step 8 — Enable Docker to start on boot
Ensure Docker starts automatically after a server reboot.
sudo systemctl enable docker
sudo systemctl enable containerd
For the official reference, see Docker’s official Ubuntu installation documentation.
Common Questions — How to Install Docker on Ubuntu 24.04
Can I install Docker on Ubuntu 24.04 with a single command?
Docker provides a convenience script at get.docker.com that automates the full installation with a single curl | sh command. This is suitable for development environments and testing, but Docker itself recommends the manual repository method for production servers because it gives you explicit control over what gets installed and how updates are managed.
What is the difference between docker.io and docker-ce on Ubuntu?
docker.io is the Docker package maintained by Ubuntu in its default repositories. It is typically 1-2 major versions behind the official release. docker-ce (Community Edition) is the package from Docker’s own repository, always up-to-date. For any serious use, always install docker-ce from Docker’s official repo.
How do I check which version of Docker is installed?
Run the following for a quick one-line summary:
docker --version
Or use the command below for detailed information about both the client and server (daemon) versions, including the API version and Go runtime version used to build Docker:
docker version
Why does Docker say “permission denied” even after installation?
This happens when your current user is not in the docker group. Run the command below and then fully log out and log back in (a new terminal window is not sufficient — you need a fresh login session for group changes to take effect). Alternatively, prefix every docker command with sudo.
sudo usermod -aG docker $USER
Conclusion
Installing Docker on Ubuntu 24.04 is a straightforward process when you follow Docker’s official repository method. Here are the three key takeaways from this guide:
- Always install Docker from the official Docker repository, not Ubuntu’s default
docker.iopackage, to get the latest features and security updates. - Include Docker Compose V2 as a plugin (
docker-compose-plugin) — it is now the standard and the old standalone binary is deprecated. - Enable Docker with
systemctl enable dockeron production servers so containers restart automatically after reboots.
Once Docker is running, your next step is deploying real applications. Check out our guide on setting up WordPress on a VPS to put your new Docker installation to work. If you found this guide helpful, share it with your team or bookmark it for your next server setup.
See also: How-To Guides: Practical Technology Tutorials for 2026 — browse all How-to articles on Hubkub.
Related Articles
- How to Set Up WordPress on a VPS for Speed and Security
- How to Improve WordPress Performance with Redis Object Cache
- How to Set Up Cloudflare for WordPress the Right Way
Last Updated: April 13, 2026







