We use tracking cookies to understand how you use the product and help us improve it. For more information on how we store cookies, read our  privacy policy.

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

  1. Go to vercel.com and sign in
  2. Click Add NewProject
  3. Import your GitHub repository
  4. Vercel will auto-detect Next.js settings

Configure Environment Variables

Add your environment variables in Vercel:

  1. Go to SettingsEnvironment Variables
  2. Add all variables from your .env.local:
    • DATABASE_URL
    • CLERK_SECRET_KEY
    • STRIPE_SECRET_KEY
    • STRIPE_WEBHOOK_SECRET
    • RESEND_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:

  1. Install dependencies
  2. Run npm run build
  3. Deploy your application
  4. Provide a production URL

Configure Custom Domain (Optional)

Add a custom domain:

  1. Go to SettingsDomains
  2. Add your domain
  3. Update DNS records as instructed
  4. 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 main branch
  • Preview: Pushes to other branches

Common Issues

Build Fails

  • Check build logs in Vercel dashboard
  • Verify all environment variables are set
  • Ensure npm run build works 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_URL is correct
  • Check database allows connections from Vercel IPs
  • Run migrations after deployment

Next Steps

How is this guide ?

Last updated on