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
- Go to vercel.com/new
- Select your GitHub repository
- Vercel auto-detects Next.js — no build settings needed
- 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:
- Go to Deployments tab
- Click the three dots on the latest deployment
- Select Redeploy
Your app should now be live.
Custom domain
- Go to Settings > Domains in Vercel
- Add your domain (e.g.,
yourdomain.com) - Follow the DNS instructions — typically add an A record or CNAME
- 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:
| Variable | Development | Preview | Production |
|---|---|---|---|
BETTER_AUTH_URL | http://localhost:3000 | Auto (Vercel URL) | https://yourdomain.com |
DATABASE_URL | Dev database | Staging database | Production 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:
- Landing page loads at your domain
- Registration and login work
- OAuth redirects correctly
- Dashboard is accessible after login
- Checkout redirects to DodoPayments (use test mode first)
- Webhooks are received (check DodoPayments logs)
Other hosting platforms
KitRocket works anywhere Next.js runs:
- Railway —
railway upwith environment variables set in the dashboard - Fly.io — use the Next.js Dockerfile
- AWS Amplify — import from GitHub, same as Vercel
- Self-hosted —
pnpm build && pnpm startbehind a reverse proxy
The only requirement is Node.js 20+ and the ability to set environment variables.
Next steps
- Go Production — full production checklist
- Custom Domain Setup — Vercel domain docs