Guide 1 of 4
Setup with CLI
Complete setup guide with every prompt explained
This is the main setup flow for buyers.
Prerequisites
1) Run setup
From the project folder:
npm install
npm run setup
The wizard will ask questions in the terminal and run commands for you.
2) Prompt-by-prompt guide
Choose your Vercel project slug
Example: my-portfolio
- This becomes your default URL:
https://my-portfolio.vercel.app - Use lowercase letters, numbers, and
- - If Vercel assigns a different URL (name already taken), setup auto-detects it, syncs URLs, and asks to redeploy.
Use a custom production domain?
Nif you want to use Vercel default domainYif you already own a domain (examplehttps://portfolio.example.com)- If the custom domain is not ready yet, use
Nfirst and switch later in Vercel + Convex.
Generate BETTER_AUTH_SECRET automatically?
- Recommended:
Y - If
N, paste your own secret (32+ characters)
Enter NEXT_PUBLIC_CONVEX_URL (.convex.cloud)
Where to find it:
- Open Convex dashboard
- Open your project
- Go to Settings (Production deployment) or Deployments → Production
- Copy the Cloud URL (ends with
.convex.cloud)
Example: https://my-project.eu-west-1.convex.cloud
This URL is used for your live site (Vercel). Setup also derives your Development deployment name from it for convex dev --once. If linking fails, copy the Development Cloud URL instead (Deployments → Development) and use that hostname’s project slug.
Enter NEXT_PUBLIC_CONVEX_SITE_URL (.convex.site)
Where to find it:
- Open Convex dashboard
- Open your project
- Go to Settings
- Copy the value under the label HTTP Actions URL (ends with
.convex.site)
Example: https://my-project.eu-west-1.convex.site
Important:
- Must end with
.convex.site - Do not paste your Vercel URL here
Enter CONVEX_DEPLOY_KEY
Where to find it:
- Open Convex dashboard
- Project → Settings → Deploy Key
- Create/copy key and paste in terminal
3) Commands the wizard can run
The wizard asks before running each step:
npx convex login- write
CONVEX_DEPLOYMENT=dev:…to.env.local npx convex env set SITE_URL … --prodandBETTER_AUTH_SECRET(Production — your live app)npx convex env set SITE_URL http://localhost:3000(Development — before first push)npx convex env set BETTER_AUTH_SECRET …(Development)npx convex dev --once(syncs Development only; updates.env.local)npx vercel loginnpx vercel link- set Vercel env vars (production, optional preview)
npx vercel --prod
If a step fails, fix the issue and run npm run setup again.
4) After deploy
When setup succeeds:
- Open your live URL
- Open
/admin/seed - Create your first admin user
- Login at
/admin - Go to
/admin/settingsand disable/admin/seed
Then continue with after-setup.md.
If the first deploy fails and the log shows a different *.vercel.app URL than expected, the wizard now updates:
- Vercel
NEXT_PUBLIC_SITE_URL - Convex
SITE_URL
and asks to redeploy automatically.