Back to site

Docker on Linux VPS: start cleanly

· Containers, Compose and best practices on a root VPS with NVMe.

Docker has transformed the way applications are deployed on a Linux VPS. Instead of manually installing every dependency on the host system, you package your stack into reproducible, versioned and isolated containers. Whether you're running an API, an admin panel or a staging environment, Docker on a VPS combines flexibility with full control — provided you size the machine correctly and follow a few basic security rules.

Why Docker on a VPS rather than locally?

A VPS gives you a public IP address, dedicated bandwidth and guaranteed uptime — three things naturally absent from your local development machine. Docker Compose lets you describe your entire stack (application, database, cache, reverse proxy) in a single YAML file, deployable with one command. Updates happen through image rebuilds, rollbacks through reverting to a previous tag — a far more predictable workflow than a manual setup accumulated over time.

Sizing your VPS for Docker

Each container consumes RAM and CPU continuously, even under light load. Add up the requirements of your services and include a 20 to 30% margin for the Docker daemon and the host system itself.

Recommended VPS sizing based on the Docker stack deployed
Stack type vCPU RAM Storage
Light stack (API + PostgreSQL) 2 4 GB 40 GB NVMe
Medium stack (app + DB + Redis + Nginx) 4 8 GB 80 GB NVMe
Multi-service / full staging 6 – 8 16 GB 160 GB NVMe

NVMe storage noticeably speeds up image pulls, multi-stage builds and persistent volumes — a particularly significant gain for containerized databases where every disk write counts.

Docker Compose: orchestration without excessive complexity

Docker Compose is sufficient for most projects deployed on a single VPS. Define your services, internal networks and volumes in a compose.yaml file, then launch with the docker compose up -d command. Containers communicate with each other through a private bridge network; only the reverse proxy (Traefik, Nginx Proxy Manager or Caddy) exposes ports 80 and 443 externally. This architecture significantly reduces the attack surface and simplifies automated SSL certificate management.

Volumes and data persistence

Never store critical data solely in a container's writable layer: use named volumes or bind mounts for databases, user uploads and logs. This ensures your data survives updates, restarts and image rebuilds, while making targeted backups easier.

Security: the essential basics

Running Docker on a VPS comes with system administration responsibilities that shouldn't be underestimated:

  • Never expose the Docker socket (port 2375/2376) directly to the Internet, or risk total host compromise.
  • Update regularly: the Linux kernel, the Docker engine and the base images you use.
  • Use a firewall (ufw or nftables) to allow only the SSH, HTTP and HTTPS ports that are strictly necessary.
  • Run containers as a non-root user whenever the application image allows it.
  • Enable Anti-DDoS protection on the hosting side to protect your publicly exposed services.

Practical tip: before going to production, scan your images with a tool like Trivy or Docker Scout to catch known vulnerabilities in your dependencies. A well-built container relies on a minimal base image (alpine or distroless) rebuilt regularly.

A solid foundation for production

A well-configured Docker VPS with a European host like HolyCloud makes a solid foundation for hosting your production applications, combining the flexibility of Compose with NVMe storage performance. This approach naturally complements a containerized WordPress deployment or a scalable application cluster. Find ready-to-use compose file examples in our technical guides, and our Anti-DDoS protection stays active upstream, with no extra configuration on your end.

Docker VPS Back to blog