Home / Docker Hosting
Docker Hosting

Docker Hosting on a VPS, Set Up Properly

Run containerised applications with Docker and Compose on a server we help you configure, secure and monitor.

Docker makes an application portable: the same image runs on your laptop, in CI and on the server. It does not make a server production-ready by itself. Someone still needs to set up TLS, persistent storage, log limits, restarts, backups and a deployment process.

Our VPS plans include root access and free DevOps support, including Docker deployment help. For many applications, Docker Compose on one well-run VPS is simpler and cheaper than a cluster. When you outgrow it, see Kubernetes management or AWS.

What a proper Docker setup includes

Docker Engine and Compose

A current, correctly installed Docker with Compose files kept in version control.

Reverse proxy and TLS

Nginx, Traefik or Caddy in front of your containers, with automatic certificates.

Persistent volumes

Databases and uploads stored on volumes, not inside containers that get replaced.

Image registries

Images pulled from Docker Hub, GitHub Container Registry or Amazon ECR.

CI/CD deployments

Push to Git, build the image, deploy it. No manual copying.

Logging and limits

Log rotation and resource limits so one container cannot fill the disk or starve the host.

Health checks and restarts

Restart policies and health checks so failures recover on their own.

Security hardening

Non-root containers, no exposed Docker socket and databases that are not public.

A production-minded Compose file

This example shows the details that separate a working Compose file from a reliable one: a pinned image tag, a localhost-only port, a health check, log limits and a database that must be healthy before the application starts.

Example: docker-compose.yml
services:
  app:
    image: ghcr.io/your-org/your-app:1.4.2
    restart: unless-stopped
    env_file: .env
    ports:
      - "127.0.0.1:3000:3000"
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://localhost:3000/health"]
      interval: 30s
      timeout: 5s
      retries: 3
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"
    depends_on:
      db:
        condition: service_healthy

  db:
    image: postgres:16
    restart: unless-stopped
    environment:
      POSTGRES_PASSWORD_FILE: /run/secrets/db_password
    secrets:
      - db_password
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 10s
      retries: 5

volumes:
  pgdata:

secrets:
  db_password:
    file: ./secrets/db_password.txt

A Docker gotcha: published ports can bypass your firewall

Docker manages its own firewall rules. A container published with -p 8080:80 can be reachable from the internet even if your UFW rules say otherwise. The safest pattern is to bind application ports to 127.0.0.1, as above, and expose only the reverse proxy.

Example: Nginx in front of the container
server {
  listen 443 ssl;
  server_name app.example.com;
  # ssl_certificate lines managed by certbot

  location / {
    proxy_pass http://127.0.0.1:3000;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }
}

How we set up Docker hosting

  1. 1

    Containerise

    Review the Dockerfile: multi-stage builds, a non-root user and a small final image.

  2. 2

    Prepare the server

    Install Docker, set the firewall, configure the reverse proxy and TLS.

  3. 3

    Deploy by pipeline

    Build and push the image, then deploy it automatically on every release.

  4. 4

    Operate

    Monitoring, volume backups and image updates become routine.

FAQ

Common questions

Something else on your mind? Message us and an engineer will answer.

Ask a Question

Compose on one VPS is enough for most small production applications. Kubernetes pays off when you need scheduling across several nodes or run many services. See Kubernetes management.

Docker deployment is part of free DevOps support. A larger containerisation effort is scoped with you first.

With database dumps and volume archives copied off the server, and restores that are tested.

Whichever fits your workflow: Docker Hub, GitHub Container Registry or Amazon ECR. We can set up any of them.

Related services

Want to run your app in Docker, properly?

Tell us about your application and we will plan the setup with you.