Deploy Vercel
Learn how to deploy your Plainform application to Vercel
Learn how to deploy your Plainform application to Vercel.
Goal
By the end of this recipe, you'll have deployed your application to Vercel with automatic deployments.
Prerequisites
- A working Plainform installation
- GitHub repository with your code
- Vercel account (free tier works)
Steps
Connect to Vercel
- Go to vercel.com and sign in
- Click Add New → Project
- Import your GitHub repository
- Vercel will auto-detect Next.js settings
Configure Environment Variables
Add your environment variables in Vercel:
- Go to Settings → Environment Variables
- Add all variables from your
.env.local:DATABASE_URLCLERK_SECRET_KEYSTRIPE_SECRET_KEYSTRIPE_WEBHOOK_SECRETRESEND_API_KEY- All other required variables
Never commit .env.local to Git. Add environment variables directly in Vercel dashboard.
Deploy
Click Deploy and wait for the build to complete. Vercel will:
- Install dependencies
- Run
npm run build - Deploy your application
- Provide a production URL
Configure Custom Domain (Optional)
Add a custom domain:
- Go to Settings → Domains
- Add your domain
- Update DNS records as instructed
- Wait for SSL certificate provisioning
Update Webhook URLs
Update webhook URLs in your integrations:
Stripe:
- Go to Stripe Dashboard → Webhooks
- Update endpoint URL to
https://yourdomain.com/api/stripe/webhook
Clerk:
- Go to Clerk Dashboard → Webhooks
- Update URLs to use your production domain
Automatic Deployments
Vercel automatically deploys when you push to GitHub:
- Production: Pushes to
mainbranch - Preview: Pushes to other branches
Common Issues
Build Fails
- Check build logs in Vercel dashboard
- Verify all environment variables are set
- Ensure
npm run buildworks locally
Environment Variables Not Working
- Redeploy after adding new variables
- Check variable names match exactly
- Ensure no trailing spaces in values
Database Connection Fails
- Verify
DATABASE_URLis correct - Check database allows connections from Vercel IPs
- Run migrations after deployment
Next Steps
- Database Migrations - Run migrations in production
Related Documentation
- Vercel Deployment - Vercel deployment guide
- Next.js Deployment - Next.js deployment docs
How is this guide ?
Last updated on