Deploy to Vercel
Import your repository, connect production services, and open your app on HTTPS.
Deploy your Node app (apps/web) from Git and connect it to production Postgres and your enabled services.
Before You Start
Have a working local app, your code in your own private Git repository, a Vercel account, and a separate production Postgres database. Prepare real mail and other enabled credentials. You can use a generated Vercel domain first, then configure your own domain and final callbacks.
1. Import the Repository
Create a Vercel project, import the full monorepo, and set Framework Preset = Next.js, Root Directory = apps/web, and Node.js = 22.x.
Keep shared packages and the root lockfile available. If the dashboard offers access to files outside Root Directory, enable it for workspace dependencies. Use the app's current config, not a website static-export setup.
2. Add Production Environment Values
Use apps/web/.env.example as your checklist. Configure in Vercel Environment Variables:
NEXT_PUBLIC_SITE_URL: this environment's HTTPS origin.DATABASE_URL: production Postgres; adjustDATABASE_POOL_MAXfor provider limits.BETTER_AUTH_SECRET,NEWSLETTER_TOKEN_SECRET: strong and stable production signing secrets.- Real Email, with
MAIL_PROVIDER=resendorcloudflare. - Credentials/products for enabled OAuth, captcha, payments, and S3 upload.
Use separate Preview data and credentials. Keep BETTER_AUTH_ENABLE_TEST_UTILS=false. Do not import your local seed passwords and localhost/test settings wholesale.
3. Apply Database Migrations
The build does not migrate data. In a separate controlled release checkout, configure apps/web/.env.local for the intended production database, confirm the target, back it up, then run:
pnpm db:status
pnpm db:migrateThe scripts load that file, not Vercel's dashboard values. Keep this checkout separate from local development. Existing customized data needs incremental upgrades. Do not run development seeds in production.
4. Deploy and Set Your Domain
Deploy, add your domain in project settings, apply Vercel's DNS records, and wait for HTTPS readiness. If the origin changes, update the public site URL, OAuth callbacks/trusted origins, and payment webhook URLs, then redeploy. NEXT_PUBLIC_* values are captured at build time.
Check Your Result
- The HTTPS homepage and both locales open.
- Real login/OTP, logout, and admin permissions work on this domain.
- Contact mail, enabled uploads, and sandbox webhooks complete their flows.
- Saved records persist in the intended database.
Complete the Release Checklist before real traffic or live payments.
Common Problems
| Problem | Fix |
|---|---|
| Shared packages cannot be resolved | Import the full workspace; check outside-root build access and root lockfile |
| Missing production credentials | Check the environment scope and redeploy after changes |
| Wrong callback domain | Match the built origin, provider callback, and trusted origins |
| Missing tables | Check that migrations and deployment target the same database |
| API timeout | Check Vercel plan limits; the app's maxDuration=300 remains subject to host limits |