Skip to main content
Tutorials

How to Install Docker on Ubuntu 24.04 (Step by Step)

Install Docker and Compose from the official repo, run your first container, and avoid the common permissions trap.

VS Volt Serv Team 6 min read

Key Takeaways

  • Install from Docker's official repository, not the older apt package, to get current versions.
  • Add your user to the docker group so you do not need sudo for every command.
  • Docker Compose is now built in as "docker compose" (no hyphen).

Docker has become the default way to run almost anything on a server — it packages an app and its dependencies into a container that runs the same everywhere. Once it is installed, deploying tools like n8n, Coolify, or your own apps becomes a one-command affair. Here is the correct, current way to install it on Ubuntu 24.04.

Why the official repository?

Ubuntu's built-in docker.io package is often out of date. Installing from Docker's official repository gets you the latest Docker Engine plus the modern Compose plugin. It is a few extra steps but worth it.

1. Set up the repository

First install the prerequisites and add Docker's GPG key and repository:

sudo apt update
sudo apt install ca-certificates curl gnupg -y

Then add Docker's official GPG key and the repository for your Ubuntu release as shown in Docker's docs (this keeps the key verifiable rather than piping a script blindly into your shell).

2. Install Docker Engine and Compose

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

That installs the engine, the CLI, the container runtime, and the Compose plugin in one go.

3. Run your first container

Confirm everything works:

sudo docker run hello-world

If you see the welcome message, Docker is running.

4. Use Docker without sudo

Typing sudo before every command gets old fast. Add your user to the docker group:

sudo usermod -aG docker $USER

Log out and back in for it to take effect. Note the security trade-off: members of the docker group effectively have root, so only add trusted users.

5. Docker Compose

Compose is now a built-in subcommand — use docker compose up -d (two words, no hyphen). Define your services in a compose.yaml file and bring an entire multi-container app up with one command. This is how most self-hosted tools are deployed today.

Where to go next

With Docker installed on your Linux VPS, you are ready to self-host a huge range of software. Try the use-case guides for ideas, and do not skip securing the server first.

Share this article
VS

Volt Serv Team

Hosting specialists at Volt Serv. We publish practical guides to help you choose, deploy, and secure your servers.

Power Your Project with Volt Serv

VPS hosting from $4.99/mo with full root access, NVMe SSD storage, free DDoS protection, and a 99.99% uptime guarantee.