Install Docker Engine on Ubuntu 24.04
Use the official convenience script — it pulls from Docker's own repo and stays current:
curl -fsSL https://get.docker.com | sh
Run Docker without sudo
usermod -aG docker $USER
Log out and back in for the group change to take effect.
Docker Compose
The classic `docker-compose` binary is gone. Compose is now built in as a subcommand:
docker compose up -d
Enable on boot
systemctl enable docker
Verify
docker run --rm hello-world
You should see "Hello from Docker!". If you don't, check `journalctl -u docker`.
Sizing tips on a small VPS
- Pin log size: `/etc/docker/daemon.json` → `{"log-opts":{"max-size":"10m","max-file":"3"}}` then `systemctl restart docker`.
- Prune weekly: `docker system prune -af --volumes`.
Pair this with our [Secure a fresh VPS](/help/secure-fresh-vps) checklist before exposing any containers to the internet.