KitRocket

Deployment

Deploy your KitRocket app to Vercel in minutes.

KitRocket is optimized for Vercel deployment. You can go from local to production in under 10 minutes.

Deploy to Vercel

Step 1: Push to GitHub

git init
git add .
git commit -m "feat: initial KitRocket setup"
git remote add origin https://github.com/your-username/your-saas.git
git push -u origin main

Step 2: Import in Vercel

  1. Go to vercel.com/new
  2. Select your GitHub repository
  3. Vercel auto-detects Next.js — no build settings needed
  4. Click Deploy

The first deploy will fail because environment variables aren't set yet. That's expected.

Step 3: Set environment variables

Go to your project's Settings > Environment Variables in Vercel and add every variable from your .env.local:

DATABASE_URL        → your Supabase connection string
AUTH_SECRET         → your generated secret
BETTER_AUTH_URL     → https://yourdomain.com
GOOGLE_CLIENT_ID    → your Google OAuth client ID
GOOGLE_CLIENT_SECRET → your Google OAuth secret
GITHUB_CLIENT_ID    → your GitHub OAuth client ID
GITHUB_CLIENT_SECRET → your GitHub OAuth secret
DODO_API_KEY        → your DodoPayments API key
DODO_WEBHOOK_SECRET → your DodoPayments webhook secret
DODO_STARTER_PRICE_ID → your starter plan price ID
DODO_PRO_PRICE_ID   → your pro plan price ID
RESEND_API_KEY      → your Resend API key
EMAIL_FROM          → noreply@yourdomain.com

For Pro tier, also add:

NEXT_PUBLIC_POSTHOG_KEY  → your PostHog key
NEXT_PUBLIC_POSTHOG_HOST → https://us.i.posthog.com
AI_PROVIDER              → anthropic or openai
AI_MODEL                 → claude-sonnet-4-20250514 or gpt-4o
ANTHROPIC_API_KEY        → your Anthropic key
OPENAI_API_KEY           → your OpenAI key

Step 4: Redeploy

After adding environment variables, trigger a redeploy:

  1. Go to Deployments tab
  2. Click the three dots on the latest deployment
  3. Select Redeploy

Your app should now be live.

Custom domain

  1. Go to Settings > Domains in Vercel
  2. Add your domain (e.g., yourdomain.com)
  3. Follow the DNS instructions — typically add an A record or CNAME
  4. Vercel provisions SSL automatically

After adding a custom domain, update these:

BETTER_AUTH_URL → https://yourdomain.com

Update OAuth callback URLs

Once you have your production URL, update callback URLs in each OAuth provider:

Google Cloud Console:

https://yourdomain.com/api/auth/callback/google

GitHub Developer Settings:

https://yourdomain.com/api/auth/callback/github

Update webhook URLs

In your DodoPayments dashboard, update the webhook endpoint:

https://yourdomain.com/api/webhook/dodo

Environment-specific settings

Use Vercel's environment scoping to set different values per environment:

VariableDevelopmentPreviewProduction
BETTER_AUTH_URLhttp://localhost:3000Auto (Vercel URL)https://yourdomain.com
DATABASE_URLDev databaseStaging databaseProduction database

Vercel preview deployments get a unique URL for each PR. You can use a separate database for preview environments.

Database migrations in production

Run migrations before or after deploying:

DATABASE_URL="your-production-connection-string" pnpm db:push

Or add a build command in package.json:

{
  "scripts": {
    "build": "pnpm db:push && next build"
  }
}

This runs migrations automatically during every Vercel build.

Verify production deployment

After deploying, check:

  1. Landing page loads at your domain
  2. Registration and login work
  3. OAuth redirects correctly
  4. Dashboard is accessible after login
  5. Checkout redirects to DodoPayments (use test mode first)
  6. Webhooks are received (check DodoPayments logs)

Other hosting platforms

KitRocket works anywhere Next.js runs:

  • Railwayrailway up with environment variables set in the dashboard
  • Fly.io — use the Next.js Dockerfile
  • AWS Amplify — import from GitHub, same as Vercel
  • Self-hostedpnpm build && pnpm start behind a reverse proxy

The only requirement is Node.js 20+ and the ability to set environment variables.

Next steps

On this page