Deployment
Vercel
Deploy your app to Vercel
Deploy to Vercel
Connect your repository
- Go to Vercel and sign in with your GitHub account
- Click Add New Project and select your repository
- Configure the following:
- Framework Preset: Next.js
- Build Command:
pnpm run buildornext build - Output Directory:
.next
Configure environment variables
Add these environment variables in your Vercel project settings:
| Variable | Value |
|---|---|
NEXT_PUBLIC_CONVEX_URL | Your Convex production URL (ends with .convex.cloud) |
NEXT_PUBLIC_CONVEX_SITE_URL | Your Convex production URL (ends with .convex.site) |
CONVEX_DEPLOYMENT | Your Convex production deployment ID (e.g., prod:your-deployment) |
CONVEX_DEPLOY_KEY | Your Convex deploy key (generate from Convex dashboard) |
For more details, see Environment Variables.
Deploy
Click Deploy to start the deployment. Once complete, your app will be live at https://your-project.vercel.app.
Verify deployment
- Visit your deployed site
- Test that authentication works
- Test any Convex-powered features
- Check that environment variables are properly set
Troubleshooting
Build fails
Make sure you're using the correct package manager (pnpm) in your Vercel project settings.
Convex connection errors
Verify that:
NEXT_PUBLIC_CONVEX_URLis set correctlyCONVEX_DEPLOYMENTmatches your Convex production deploymentCONVEX_DEPLOY_KEYis valid and not expired
Custom domain
To add a custom domain, go to Settings → Domains in your Vercel project and follow the instructions to configure DNS records.