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 | shRun Docker without sudo
usermod -aG docker $USERLog 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 -dEnable on boot
systemctl enable dockerVerify
docker run --rm hello-worldYou 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"}}thensystemctl restart docker. - Prune weekly:
docker system prune -af --volumes.
Pair this with our Secure a fresh VPS checklist before exposing any containers to the internet.