Install Docker and Compose on a Debian or Ubuntu VPS
Official script, checking the Compose plugin, a first nginx service and security rules: install Docker on a Linux VPS step by step.
On a Debian or Ubuntu VPS, install Docker with the official script, check the Compose plugin with docker compose version, then run a test container. Allow about ten minutes. Add your user to the docker group only if you accept its rights, which are equivalent to root.
- Install Docker with the official script, then check with docker compose version.
- The docker group gives root-equivalent rights: reserve it for a trusted account.
- Publishing a port exposes it on the network: open only the ports you need.
- The Linux Mini plan, at 4.99 € as of 7 November 2026, is enough to test Docker.
Update the system
Start with up-to-date packages so Docker is not installed on an outdated base. Connect over SSH with your user, then run: sudo apt update && sudo apt upgrade -y. Restart if the kernel has changed.
- The command is the same on Debian and on Ubuntu.
- Check your system with cat /etc/os-release.
Install Docker
Download the official script with curl -fsSL https://get.docker.com -o get-docker.sh, read it if you wish, then run it with sudo sh get-docker.sh. It installs the Docker engine, its client and the Compose plugin.
- Compose version 2 is used with docker compose, with a space.
- The old docker-compose version 1 is discontinued: do not install it.
Check the installation
Three commands are enough: docker --version, docker compose version, then sudo docker run --rm hello-world. If the Hello from Docker! message appears, the engine works.
- A permission error on the socket means you still need sudo in front of the command.
- hello-world is downloaded from Docker Hub: the VPS must be able to reach the internet.
Use Docker without sudo
Add your user to the docker group with sudo usermod -aG docker $USER, then reconnect over SSH. Be careful: a member of the docker group can gain root rights, so reserve it for a trusted account.
- Create a dedicated account for deployments instead of working as root.
- Without reconnecting, the new group membership is not applied.
Run a first Compose service
In a folder, create a compose.yaml file with an nginx service that publishes port 8080 to port 80 of the container, then run docker compose up -d. Then test with curl http://localhost:8080 from the server.
- A published port is open on the network: check the firewall, see secure a Linux VPS.
- Do not publish a database such as PostgreSQL or MySQL: keep it on Docker’s internal network.
Why choose ACLClouds for Docker
Docker runs on a KVM virtual machine, with its own Linux kernel. The Essentiel plan gives 16 GB of RAM, 4 vCPU and 80 GB of storage, at 9.99 € as of 7 November 2026. Servers are located in France and the control panel is available in 7 languages.
- The Mini plan, at 4.99 € as of 7 November 2026, with 8 GB of RAM, is enough to test Docker.
- The difference between a KVM virtual machine and containers is explained in KVM or containers.
Frequently asked questions
Is Docker Desktop needed on a server?
No. On a Linux server, the Docker engine and the Compose plugin are enough. Docker Desktop is an application designed for a workstation.
Why does the "permission denied" message appear?
Your user is not in the docker group, or the session was not reloaded. Reconnect over SSH, or put sudo in front of the command.
Can a published port bypass the firewall?
Yes: Docker writes its own rules, and a published port can stay reachable even if ufw blocks it. Publish only what must be public, then check from another network.