Hosting Guide
Streamix needs somewhere to run a Next.js app, a PostgreSQL database and an S3-compatible bucket. If you want adaptive HLS, it also needs a machine that can run ffmpeg. This guide compares the options. For step-by-step deployment see the Deployment Guide.
What every setup needs
| Piece | Requirement | Recommended |
|---|---|---|
| Web app | Node.js 20+, serverless or long-running | Vercel, or a VPS/container |
| Database | PostgreSQL 14+ | Neon (serverless, branching, point-in-time restore) |
| Storage | S3-compatible bucket with a public URL, CORS for your origin | Cloudflare R2 (no egress fees) |
| Scheduler | Something that calls /api/v1/cron hourly |
Vercel Cron, or system cron |
| Transcode worker (optional) | A VM/container with CPU and scratch disk | A small VM or worker service near the database |
| HTTPS | Required for secure cookies, web push and license activation | Your host's managed certificates |
Bandwidth is the main cost of a streaming service. Every minute watched is downloaded from your bucket or CDN. Choose storage with low or no egress fees (R2) or put a CDN in front, and estimate: hours watched × bitrate.
Option 1: Vercel + Neon + R2 (managed)
The lowest-maintenance setup.
vercel.jsonsets the build and registers the hourly cron.- The filesystem is read-only: set environment variables in the dashboard (the wizard can't write
.env), and all uploads go to the bucket (they already do). - Run the transcode worker elsewhere (see Option 3), or skip HLS and play MP4.
- Put the Vercel region next to your Neon region.
Good for: getting started, small to medium catalogues, teams without ops staff.
Option 2: A single VPS
Run everything on one server (DigitalOcean, Hetzner, Linode, Vultr, Lightsail…), with the database either managed (Neon) or local Postgres.
npm install && npm run build
pm2 start "npm run start" --name streamix
pm2 start "npm run worker:transcode" --name streamix-transcode
pm2 save
# crontab: 0 * * * * curl -fsS -H "Authorization: Bearer $CRON_SECRET" https://watch.example.com/api/v1/cron
Put nginx or Caddy in front for HTTPS. The wizard can write .env and the .installed lock on a writable disk.
Good for: predictable monthly cost, full control. Watch CPU: transcoding a film is heavy and competes with the web app; a second small VM for the worker is often worth it.
Option 3: Containers
Build one image and run it as two services:
- web:
npm run start(scale horizontally behind a load balancer) - worker:
npm run worker:transcode(scale by replicas; jobs are claimed safely withSKIP LOCKED)
Add a scheduled job for the cron URL. Works on Fly.io, Render, Railway, Kubernetes, ECS and similar. Note that the built-in rate limiter is per instance.
Good for: larger audiences, separate scaling of web and transcoding.
Storage choices
| Provider | Notes |
|---|---|
| Cloudflare R2 | Free provider (no add-on license needed); no egress fees; use a custom domain for the public URL |
| Amazon S3 | Premium add-on; pair with CloudFront to control egress cost |
| DigitalOcean Spaces | Premium add-on; built-in CDN |
| Google Cloud Storage | Premium add-on (S3-interoperable mode) |
Whatever you choose, configure it in the admin (Configuration → Add-ons → Storage) and run scripts/setup-r2-cors.ts for your origins.
Database choices
- Neon: recommended. Use the pooler URL for the app, the direct URL for dumps and imports; branches make safe pre-upgrade snapshots.
- Self-hosted or other managed Postgres: works through the standard driver. Enable
pg_trgmfor typo-tolerant search.
Sizing hints
- Web app: modest. Most pages are server-rendered queries; media never passes through it.
- Database: grows with members, viewing history and play sessions more than with the catalogue.
- Worker: encoding time depends on CPU cores and how many rungs the source allows (up to seven, 240p-2160p). Time one of your own titles before planning capacity.
- Storage: keep room for sources plus all HLS renditions and thumbnails.
© CreativeCape Solutions · creative-cape.com · support@creative-cape.com