In an era of rising commercial SaaS subscription fees, data scraping, and invasive privacy policies, self-hosting your own cloud storage infrastructure provides total sovereignty over your personal and enterprise files.

Nextcloud Hub is the world’s leading open-source collaboration platform, offering encrypted file syncing, calendar/contacts integration, office document editing via Collabora/OnlyOffice, and private WebRTC video calling. In this complete 2026 production blueprint, we deploy a lightning-fast, production-grade Nextcloud instance on a Cloud VPS using Docker Compose, Redis memory caching, and PostgreSQL.

1. Recommended Server Hardware & VPS Sizing

For a responsive Nextcloud instance serving 5 to 50 active users with desktop file synchronization and mobile photo auto-upload, allocate the following hardware resources:

Small / Personal

1 to 5 Users

2 vCPU Cores, 4GB RAM, 80GB NVMe SSD. Ideal on Cloudzy ($4.99/mo) or Hetzner.

Medium / Team

5 to 25 Users

4 vCPU Cores, 8GB RAM, 200GB+ NVMe SSD + Redis. Ideal on Contabo or Vultr.

Enterprise Scale

25 to 100+ Users

8 vCPU Cores, 16GB RAM, Dedicated Object Storage (S3 / MinIO backend).

2. Production Docker Compose Stack (Nextcloud + PostgreSQL + Redis + Nginx)

Below is the optimized docker-compose.yml file incorporating transactional file locking via Redis and high-performance relational storage via PostgreSQL 16:

version: '3.8'

services:
  db:
    image: postgres:16-alpine
    restart: always
    volumes:
      - db_data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=nextcloud
      - POSTGRES_USER=nextcloud
      - POSTGRES_PASSWORD=YourSecureDatabasePassword123!
    networks:
      - nextcloud_network

  redis:
    image: redis:alpine
    restart: always
    command: redis-server --requirepass YourSecureRedisPassword123!
    networks:
      - nextcloud_network

  app:
    image: nextcloud:apache
    restart: always
    depends_on:
      - db
      - redis
    ports:
      - "8080:80"
    volumes:
      - nextcloud_data:/var/www/html
    environment:
      - POSTGRES_HOST=db
      - POSTGRES_DB=nextcloud
      - POSTGRES_USER=nextcloud
      - POSTGRES_PASSWORD=YourSecureDatabasePassword123!
      - REDIS_HOST=redis
      - REDIS_HOST_PASSWORD=YourSecureRedisPassword123!
      - NEXTCLOUD_ADMIN_USER=admin
      - NEXTCLOUD_ADMIN_PASSWORD=YourSecureSuperAdminPassword123!
      - NEXTCLOUD_TRUSTED_DOMAINS=cloud.yourdomain.com
    networks:
      - nextcloud_network

volumes:
  db_data:
  nextcloud_data:

networks:
  nextcloud_network:
    driver: bridge
        

3. Reverse Proxy & Automated SSL with Nginx

Expose your Nextcloud instance securely to the public internet using Nginx with HTTP/2 and modern TLS 1.3 encryption:

server {
    server_name cloud.yourdomain.com;

    client_max_body_size 16G;
    client_body_timeout 300s;
    fastcgi_buffers 64 4K;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_buffering off;
    }

    location /.well-known/carddav { return 301 $scheme://$host/remote.php/dav; }
    location /.well-known/caldav  { return 301 $scheme://$host/remote.php/dav; }
}
        

For proxy caching, high-speed reverse proxy nodes, and regional bandwidth providers, check 5-proxy.com and cloud hosting ratings on vpsrated.com.