DeploymentDeployment Overview

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.

ServiceContainerPortHealth
FrontendNext.js3000
BackendExpress5000GET /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 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

VariablePurpose
BETTER_AUTH_SECRETSession signing secret — generate with openssl rand -base64 32
DATABASE_URLDatabase connection string
FRONTEND_ORIGINFrontend URL, for CORS
BACKEND_PUBLIC_URLPublic 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

VariablePurpose
NEXT_PUBLIC_API_BASE_URLPublic URL of the backend API

Production checklist

  • Set BETTER_AUTH_SECRET
  • Set DATABASE_URL
  • Set FRONTEND_ORIGIN and BACKEND_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/health responds

Next steps