Database (Neon)
Setup creates a Neon Postgres database, checks your network can reach it, and creates the tables.
What you need
A free Neon account.
Steps
Create a Neon API key
- Open console.neon.tech.
- Click your avatar → Account settings → API keys.
- Click Create new API key, give it any name, and copy it.
Paste it when setup asks for Neon API key. This key is only used to create the database; it isn't saved.
Choose an organization
If your Neon account belongs to more than one organization, setup asks which one to use. With one organization, it's chosen for you.
Choose a region
| Option | Pick it when |
|---|---|
| Asia Pacific (Singapore) | You and most of your users are in India or South-East Asia |
| US East (N. Virginia) | You'll host on Vercel's default region, or most users are in the Americas |
| Europe (Frankfurt) | Most users are in Europe |
If you deploy with setup, your server functions are moved to the Vercel region next to this database, so every query stays fast. See Deploy.
Setup creates the database
A Neon project named after your project folder is created, and its connection string is saved as DATABASE_URL.
Network check
Setup looks up the database's hostname. Some networks (common on some Indian ISPs) refuse to resolve Neon's hostnames. If yours does, setup stops with Can't reach the database and shows how to switch to public DNS. See the fix.
Tables are created
Setup runs the migrations in drizzle/ (drizzle-kit migrate) and prints Database ready.
Using an existing database
Already have a Postgres connection string (from another Neon project or a different provider)? Put it in .env.local before running setup:
DATABASE_URL=postgresql://user:password@host/dbname?sslmode=requireSetup asks The database is already set up. Keep it? Choose Yes; it still checks the connection and runs the migrations.
The kit connects with Neon's serverless driver (@neondatabase/serverless), which talks to Neon over HTTP. Other Postgres hosts need a change to src/db/index.ts.
Local and production share this database
When you deploy with setup, production uses the same DATABASE_URL. That keeps setup simple, but accounts you create while testing locally also exist in production. To keep them apart, create a second Neon project (or a Neon branch) for production, set its DATABASE_URL in Vercel, and run npm run db:migrate against it.
Problems
See Database errors.
How setup works
npm run setup takes a fresh clone to a working app, and optionally a live deployment. This page explains what it does, in what order, and how re-running it works.
Payments (Dodo)
Setup checks your Dodo Payments API key, works out whether it's a test or live key, and creates a Dodo product for every plan you sell.