Skip to content

Hosting & Infrastructure

This document describes the hosting infrastructure for the Freeze Design webshop, including provider choices, cost breakdown, and scaling options.

Current Infrastructure

Production is planned, not live

Only the staging environment (staging.freezedesign.eu) is live. There is no production deployment yet; the production-oriented configuration (docker-compose.prod.yml) exists in the repo but is not deployed anywhere, and the Deploy to Production workflow is disabled. The live staging stack runs from docker-compose.staging.yml.

The description below reflects the live staging box. Figures marked "prod target" describe the future production sizing baked into docker-compose.prod.yml.

Component Provider Details
VPS Hetzner Cloud ~2 GB RAM staging (PostgreSQL tuned with shared_buffers=512MB); ~4 GB RAM prod target
Media storage DigitalOcean Spaces ams3 (Amsterdam) region, S3-compatible via django-storages
Database backups AWS S3 Hourly encrypted pg_dump uploads (BACKUP_S3_BUCKET)
SSL Let's Encrypt Free, auto-renewed (GitHub Actions + VPS cron, see Disaster Recovery)
CDN Cloudflare Free plan, see Cloudflare CDN
Monitoring UptimeRobot + Sentry Free tiers
Datacenter Germany EU location for GDPR compliance

VPS sizing

The staging VPS is described by specs, not a model number. An earlier internal note referenced a Hetzner "CX33 (8 GB)" box, but that does not match the deployed compose files: staging runs with shared_buffers=512MB (a ~2 GB box) and the prod target (docker-compose.prod.yml) sums container mem_limits to roughly 4 GB. Treat 8 GB / 4 vCPU as an aspirational upper bound, not the current machine.

The application runs as 7 Docker containers orchestrated by Docker Compose:

  1. nginx -- reverse proxy, SSL termination, static file serving
  2. backend -- Django/Gunicorn application server
  3. frontend -- Next.js server-side rendering
  4. db -- PostgreSQL 15 with production tuning
  5. redis -- session cache and Celery broker
  6. celery -- asynchronous task worker
  7. celery-beat -- periodic task scheduler

Provider Comparison

Reference pricing for Hetzner Cloud tiers and competitors, to inform the eventual production sizing. Staging currently runs on a ~2 GB tier.

Provider Tier vCPU RAM Storage Traffic Price/mo
Hetzner ~2 GB (staging today) 2 2 GB 40 GB NVMe 20 TB ~EUR 3.79
Hetzner ~4 GB (prod target) 2 4 GB 40 GB NVMe 20 TB ~EUR 4.99
Hetzner 8 GB (headroom option) 4 8 GB 80 GB NVMe 20 TB ~EUR 7.49
DigitalOcean Basic shared 2 4 GB 80 GB SSD 4 TB ~EUR 22
Contabo Cloud VPS S 4 8 GB 75 GB NVMe Unlimited EUR 4.99

Prices as of early 2026. DigitalOcean price estimated from USD 24/month.

Why Hetzner

Technical Fit

PostgreSQL is tuned per environment for the available RAM. The staging configuration (docker-compose.staging.yml) runs on a ~2 GB box:

  • shared_buffers=512MB, effective_cache_size=1536MB
  • work_mem=4MB, maintenance_work_mem=128MB
  • max_connections=50

The production target (docker-compose.prod.yml) assumes ~4 GB (container mem_limits sum to roughly 3.5 GB, leaving OS/Docker headroom):

  • shared_buffers=1GB, effective_cache_size=3GB
  • work_mem=8MB, maintenance_work_mem=256MB
  • max_connections=50

The remaining memory covers Django/Gunicorn workers, Next.js, Redis, Celery, Nginx, and Docker overhead.

20 TB/month traffic far exceeds expected demand for a custom apparel e-commerce site.

NVMe storage is sufficient because media files live on DigitalOcean Spaces and database backups go to AWS S3. The VPS only stores application code, Docker images, and the PostgreSQL data directory.

Cost Advantage

  • Significantly cheaper than DigitalOcean for equivalent or better specs
  • No hidden fees: IPv4 address included, firewall free, snapshots inexpensive
  • Contabo offers similar specs, but Hetzner has a stronger track record for performance consistency and customer support

EU Compliance

  • German datacenter locations
  • ISO 27001 certified
  • Meets GDPR data residency requirements for EU-based customers

Full TCO Breakdown (Monthly)

Service Provider Cost
VPS (~2 GB staging, ~4 GB prod target) Hetzner Cloud ~EUR 3.79-4.99
Volume (20 GB) Hetzner EUR 1.04
Snapshot backups (10 GB est.) Hetzner EUR 0.12
Domain (freezedesign.eu) Yearly / 12 ~EUR 0.75
SSL certificates Let's Encrypt FREE
Monitoring UptimeRobot + Sentry free tiers FREE
CDN Cloudflare free plan FREE
Media storage DigitalOcean Spaces ~EUR 5.00
Database backups AWS S3 ~EUR 0.50
Total ~EUR 11-13/month

Annual cost: approximately EUR 130-160/year (depending on the final VPS tier).

Pricing Notes

  • Hetzner volumes: EUR 0.052/GB/month (20 GB = EUR 1.04)
  • Hetzner snapshots: EUR 0.012/GB/month (10 GB = EUR 0.12)
  • DigitalOcean Spaces: 250 GB storage + 1 TB transfer included for USD 5/month
  • AWS S3 backup: minimal cost for periodic database dumps (~EUR 0.50/month estimated)

Database Strategy

Decision: PostgreSQL in Docker container (not managed).

Why Docker PostgreSQL

  1. Hetzner does not offer managed PostgreSQL. Keeping the database on the same VPS avoids cross-provider latency and simplifies the architecture.
  2. Already proven. The application was developed and tested with Docker PostgreSQL. Production tuning parameters are baked into docker-compose.prod.yml.
  3. Automated backups. Hourly pg_dump to AWS S3 with tiered retention, AES-256-GCM encrypted. Scheduled by Celery Beat (backend/config/celery.py) — see Disaster Recovery.
  4. No additional cost. Managed database services start at USD 15/month, which would more than double the TCO.

Configuration

  • Image: postgres:15-alpine (official PostgreSQL Docker image)
  • SSL/TLS: Enabled with certificates for container-to-container encryption
  • Backups: Automated hourly dumps to AWS S3 (see Disaster Recovery)
  • Health checks: pg_isready with 30-second intervals

Managed Database Alternative

If future requirements demand managed PostgreSQL (automated failover, compliance mandates, database size exceeding VPS capacity):

Provider Plan Starting Price
DigitalOcean Managed Database 1 GB / 1 vCPU ~USD 15/month
AWS RDS for PostgreSQL db.t4g.micro ~USD 15-20/month

Migration path: standard pg_dump / pg_restore, then update DATABASE_URL in the application environment.

Scaling Options

Vertical: Upgrade VPS Plan

The simplest scaling path. Hetzner allows live plan upgrades with brief downtime (5-10 minutes for VPS resize). No code changes required.

Tier vCPU RAM Storage Price/mo
~2 GB (staging today) 2 2 GB 40 GB ~EUR 3.79
~4 GB (prod target) 2 4 GB 40 GB ~EUR 4.99
~8 GB (headroom) 4 8 GB 80 GB ~EUR 7.49
~16 GB 8 16 GB 160 GB ~EUR 14.99
~32 GB 16 32 GB 320 GB ~EUR 29.99

After upgrading, adjust PostgreSQL tuning parameters in docker-compose.prod.yml to take advantage of the additional RAM.

Managed Database

Offload PostgreSQL to a managed service while keeping the application on Hetzner:

  • Migrate to DigitalOcean Managed PostgreSQL or AWS RDS
  • Update DATABASE_URL environment variable
  • Estimated total: EUR 7.49 (Hetzner) + ~EUR 14 (managed DB) = ~EUR 22/month

Consider this when:

  • Automated failover and high availability become requirements
  • The database outgrows the VPS disk or memory
  • Compliance mandates separation of compute and data

Horizontal: Multiple VPS Instances

For significant traffic growth:

  • Hetzner Load Balancer (EUR 5.49/month) distributing across multiple application VPS instances
  • Managed or dedicated database server
  • Redis Cluster or managed Redis for shared session/cache state
  • Cloudflare CDN already handles static asset distribution

This level of scaling is unlikely to be needed in the foreseeable future for a custom apparel e-commerce site.

Why DigitalOcean Spaces for Media

Media storage uses DigitalOcean Spaces rather than Hetzner Object Storage:

  1. Already configured. The Django storage backend (django-storages S3Storage, enabled via USE_SPACES / DO_SPACES_* env vars) is working on staging.
  2. ams3 (Amsterdam) region. EU datacenter, consistent with GDPR requirements.
  3. Simple pricing. Flat USD 5/month for 250 GB storage and 1 TB outbound transfer. No per-request fees to worry about.
  4. Built-in CDN. Spaces includes a CDN endpoint, though we primarily serve media through Cloudflare for additional caching and DDoS protection.

Switching to Hetzner Object Storage would save approximately EUR 1-2/month but would require reconfiguring the storage backend and re-uploading all media files. Not worth the effort at current scale.