Skip to main content
You’ve built something cool locally. Now let’s get it in front of real users. This guide walks you through deploying to Vercel — the recommended (and easiest) target for this repo.

Before You Deploy

Make sure you’ve checked off these prerequisites:
Your app runs and works locally
Better Auth env vars are configured
Drizzle migrations have been applied to your production database
You know your production domain
You have your env vars ready to paste into Vercel

Deploy to Vercel

1

Push your repo to GitHub

If you haven’t already, push your code to a GitHub repository. Vercel connects directly to GitHub for automatic deployments.
2

Import into Vercel

Head to vercel.com, click Add New Project, and import your GitHub repo. Vercel will auto-detect that it’s a Next.js app.
3

Configure build settings

Use these defaults:
SettingValue
Install commandpnpm install
Build commandpnpm build
Start commandpnpm start
4

Add your production env vars

At minimum, you need these:
NEXT_PUBLIC_APP_URL=https://yourdomain.com
BETTER_AUTH_SECRET=...
DATABASE_URL=postgresql://...
Plus at least one LLM provider key:
OPENAI_API_KEY=...
DATABASE_URL should point to your production PostgreSQL connection string. Keep it server-side only — never use a NEXT_PUBLIC_ prefix for it.
5

Hit Deploy

Click deploy and watch your app go live. Vercel will build and deploy it automatically.

After Deployment

Once your app is live, come back and update these settings to use your production domain:
1

Update auth-related URLs

  • Set NEXT_PUBLIC_APP_URL to your live domain (if not already)
  • Update BETTER_AUTH_URL if you use the override
  • Update your Google OAuth redirect URIs to https://yourdomain.com/api/auth/callback/google
  • Update auth email sender/domain settings in your email provider
2

Update payment and webhook URLs

Point your payment webhook URLs to your live domain. Each payment provider (Polar, Stripe, LemonSqueezy) has its own webhook settings — update them to use your production URL.
3

Update any other provider callback URLs

If you use any other services with callback URLs or allowlists, make sure they know about your new domain.

Optional Env Vars

You only need to add env vars for the features you actually use. Here are the common extras:
EMAIL_PROVIDER=...
AUTH_EMAIL_FROM=...
AUTH_EMAIL_REPLY_TO=...
OpenAI is still required if you want PDF RAG embeddings or GPT Image, even if you use a different LLM provider for chat.

Post-Deploy Verification

Run through this checklist to make sure everything is healthy:
The live landing page loads
Auth works on the live domain (sign up, sign in)
/ loads after sign-in
Your main enabled feature works in production

Mintlify Docs

If you connect Mintlify to this repo, point the docs root to docs/public. Your docs will auto-deploy alongside your app.