← Blog
How to Install Docker on Ubuntu in 2 Minutes

Every other tutorial out there makes this way more complicated than it needs to be. You don't need to add GPG keys manually, configure apt repositories by hand, or understand the difference between docker.io and docker-ce. Just run this.

The fast way

SSH into your VPS and run:

curl -fsSL <https://get.docker.com> | sh

That’s it. This is Docker’s official convenience script. It detects your distro, adds the right repository, and installs Docker Engine plus Docker Compose v2. Works on Ubuntu 22.04, 24.04, Debian 11, 12, and most other common distros.

Verify it worked:

docker --version
docker compose version

You should see something like Docker version 27.x and Docker Compose version v2.x.

Make Docker start on boot

sudo systemctl enable docker

Now if your VPS reboots (maintenance, power issue, whatever), Docker comes back up automatically. Your containers restart too, as long as you set them up with restart: unless-stopped or restart: always in your compose files.

Run Docker without sudo (optional)

By default, Docker requires root. If you want to run docker commands as a non-root user:

sudo usermod -aG docker $USER
newgrp docker

Log out and back in for the group change to fully take effect. After that, docker ps works without sudo.

Fair warning: adding a user to the docker group gives them root-equivalent access to the system. On a personal VPS where you're the only user, this is fine. On a shared server, think twice.

Test with a quick container

docker run --rm hello-world

If you see the "Hello from Docker!" message, everything is working. The --rm flag removes the container after it exits — no cleanup needed.

What to run next

Now that Docker is ready, you can deploy pretty much anything in minutes:

  • OpenClaw — self-hosted AI assistant (check our OpenClaw deployment guide)
  • Nginx Proxy Manager — reverse proxy with a UI and auto SSL
  • Uptime Kuma — self-hosted monitoring (like UptimeRobot but free)
  • n8n — workflow automation (like Zapier but on your server)
  • Portainer — Docker management UI if the terminal isn’t your thing

All of these run with a single docker compose up -d command.

One thing to watch

Docker images and containers eat disk space quietly. After a few weeks of experimenting, you might find 10-20 GB gone. Clean up with:

docker system prune -af

This removes stopped containers, unused images, and build cache. Run it periodically, or when df -h shows your disk getting full.

Dedimax VPS plans come with NVMe storage and unlimited bandwidth — enough room to run a handful of Docker services without worrying about space or traffic limits.

Continue reading

Zona comunitaria

Una pregunta ?
¡Encuentra respuestas y comparte tus conocimientos!

Te estamos esperando zona comunitaria. Más que 70 guías (sysadmin, gaming, devops...) !

Permítame verificar
DEDIMAX DEDIMAX DEDIMAX DEDIMAX
DEDIMAX

¿Necesita una cotización?

Escribenos !

Contáctenos

Prendre contact