Deployment Overview
How SiteKnock apps deploy — two independent containers, external services, and the environment variables you need to set.
The deployment model
A SiteKnock app deploys as two independent containers: a Next.js frontend and an Express backend. Separating them lets you scale, restart, and roll out each tier on its own.
| Service | Container | Port | Health |
|---|---|---|---|
| Frontend | Next.js | 3000 | — |
| Backend | Express | 5000 | GET /api/health |
External services
In production you connect your app to managed or self-hosted services:
- Database — PostgreSQL (recommended), MySQL/MariaDB, SQLite, or SQL Server.
- Storage — S3-compatible (AWS S3, Cloudflare R2, MinIO) or filesystem.
- Email — SMTP, Resend, Mailgun, or SES.
- Stripe — when billing is enabled.
- Redis — for shared cache and rate limiting across multiple replicas.
The recommended path: Studio
The simplest way to deploy is Studio's deploy flow, which builds your containers, applies migrations, starts services with your configured environment, and runs health checks.
Environment variables
Backend
| Variable | Purpose |
|---|---|
BETTER_AUTH_SECRET | Session signing secret — generate with openssl rand -base64 32 |
DATABASE_URL | Database connection string |
FRONTEND_ORIGIN | Frontend URL, for CORS |
BACKEND_PUBLIC_URL | Public URL of the backend |
STORAGE_* | Storage provider credentials (for S3) |
EMAIL_* | Email provider credentials |
STRIPE_* | Stripe keys and webhook secret (if billing is enabled) |
Frontend
| Variable | Purpose |
|---|---|
NEXT_PUBLIC_API_BASE_URL | Public URL of the backend API |
Production checklist
- Set
BETTER_AUTH_SECRET - Set
DATABASE_URL - Set
FRONTEND_ORIGINandBACKEND_PUBLIC_URL - Configure Stripe keys and webhook secret (if billing)
- Configure your email provider and credentials
- Set
NEXT_PUBLIC_API_BASE_URL - Configure your storage provider and credentials
- Apply database migrations
- Verify
GET /api/healthresponds
Next steps
Was this page helpful?