Deployment

Deploy to Vercel, Docker, or Railway. Includes Docker local dev setup and production container build.

1

Push to GitHub

git push origin main
2

Import in Vercel

Go to vercel.com/new → Import your repository.

3

Add environment variables

Add every variable from .env.example. The required ones are:

DATABASE_URL="postgresql://..."
AUTH_SECRET="your-32-byte-secret"   # openssl rand -base64 32
NEXTAUTH_URL="https://yourdomain.com"

All other env vars (payment providers, email, feature flags, etc.) should also be added.

4

Deploy

Click Deploy. Vercel runs pnpm build automatically.

5

Configure webhooks

After deploy, update webhook URLs in your payment dashboards:

  • LemonSqueezy: Settings → Webhooks → https://yourdomain.com/api/webhooks/lemonsqueezy
  • Polar: Settings → Webhooks → https://yourdomain.com/api/webhooks/polar
  • Stripe: Dashboard → Developers → Webhooks → https://yourdomain.com/api/webhooks/stripe
6

Run database migration

Run from your local machine (pointing at production DB):

DATABASE_URL="your-production-db-url" pnpm db:push

Or use prisma migrate deploy if you have migration history.

7

Create your SuperAdmin account

DATABASE_URL="your-production-db-url" pnpm make-superadmin your@email.com

Local Development with Docker

Use Docker to run PostgreSQL locally without installing it on your machine.

# Start PostgreSQL (postgres:17-alpine on port 5432)
pnpm docker:dev

# Set DATABASE_URL in .env.local
DATABASE_URL="postgresql://launchfst:launchfst@localhost:5432/launchfst"

# Push schema
pnpm db:push

# Start dev server
pnpm dev

# Stop PostgreSQL when done
pnpm docker:down

Docker Compose credentials: user launchfst, password launchfst, database launchfst.


Docker Production Build

The included Dockerfile uses a multi-stage build on node:22-alpine:

  1. deps — install dependencies with pnpm install --frozen-lockfile
  2. builder — generate Prisma client and run pnpm build
  3. runner — minimal production image with next start
# Build the image
docker build -t yoursaas:latest .

# Run the container
docker run -p 3000:3000 \
  -e DATABASE_URL="postgresql://..." \
  -e AUTH_SECRET="..." \
  -e NEXTAUTH_URL="https://yourdomain.com" \
  yoursaas:latest

Or use the production Docker Compose file:

pnpm docker:build   # docker compose -f docker-compose.prod.yml build
pnpm docker:prod    # docker compose -f docker-compose.prod.yml up -d

Railway

1

Create a new project

Go to railway.app → New Project → Deploy from GitHub repo.

2

Add a PostgreSQL service

Click "+ New" → Database → PostgreSQL. Railway injects DATABASE_URL automatically.

3

Add environment variables

In Railway → your service → Variables, add all required env vars from .env.example.

4

Deploy

Railway auto-deploys on every push to your default branch.


Available Scripts

CommandDescription
pnpm devStart Next.js dev server with Turbopack
pnpm buildProduction build
pnpm startStart production server
pnpm lintRun ESLint
pnpm db:pushPush Prisma schema to database
pnpm db:generateRegenerate Prisma client
pnpm db:studioOpen Prisma Studio
pnpm make-superadminPromote a user to SUPERADMIN
pnpm seed-demoSeed demo users and org
pnpm email:previewStart React Email preview server (port 3001)
pnpm docker:devStart local PostgreSQL via Docker Compose
pnpm docker:downStop local Docker Compose services
pnpm docker:buildBuild production Docker image
pnpm docker:prodRun production Docker Compose

Post-Deploy Checklist

  • NEXTAUTH_URL is set to the production domain (not localhost)
  • AUTH_SECRET is a secure random string (32+ bytes)
  • DATABASE_URL points to the production database
  • Prisma schema is pushed: pnpm db:push
  • SuperAdmin account created: pnpm make-superadmin your@email.com
  • Payment webhook URLs updated in provider dashboards
  • Email provider configured and domain verified
  • Feature flags set correctly for production

Demo Mode — Explore freely. Some actions are restricted. demo@launchfst.dev / demo1234

Get LaunchFst →