Browse docs

Deployment

For people hosting their own Linktrap instance (Vercel + Turso, etc.). Not required if you only use someone else’s site.

End users who only create links on an existing deployment can skip this page — use Getting started instead.

Build

npm ci
npm run lint
TURSO_DATABASE_URL=… NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=… CLERK_SECRET_KEY=… npm run build

Production builds need valid Clerk env vars. When TURSO_DATABASE_URL is set, npm run build runs drizzle-kit push first so the remote database matches db/schema.ts (same step as npm run db:push). On Vercel, add TURSO_DATABASE_URL (and token if needed) to Build environment variables, not only Production runtime. Use SKIP_DB_PUSH=1 or npm run build:next to build without pushing.

Database migration

For a one-off sync or local use, you can still run:

TURSO_DATABASE_URL=… TURSO_AUTH_TOKEN=… npm run db:push

Deploys that run npm run build with Turso env applied will push automatically. See Database schema.

Vercel

  • Set all variables from Environment variables.
  • Add your production domain; set NEXT_PUBLIC_APP_URL to match.
  • Configure Stripe webhook endpoint URL: https://your.app/api/stripe/webhook and events you handle (checkout completed, subscription updated/deleted).
  • Clerk: add production domain / authorized redirect URLs per Clerk docs.

Custom domains (short links)

Pro customers can register hostnames via the API; you must add the domain to your hosting provider, TLS, and mark rows verified when DNS is correct — Custom domains.

Go-live checklist

See operational checklist in Troubleshooting and legal links on the marketing site footer.