MyApp

Getting Started

Introduction

Content & Marketing

Add Blog PostAdd Blog AuthorAdd TestimonialsCustomize HeroAdd FAQ Items

Payments

Add Stripe ProductCreate Stripe SubscriptionAdd Stripe CouponCustomize CheckoutTest Payments Locally

Authentication

Customize Sign-InAdd OAuthImplement RolesProtect Routes

Content Management

Add Doc PageCreate Doc SectionCustomize Theme

Customization

Change ColorsAdd FontCustomize EmailsUse PostHog Analytics

Deployment

Deploy VercelDatabase Migrations

Advanced

Server ActionsAdd Rate Limiting
MyApp

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 New → Project
  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 Settings → Environment 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 Settings → Domains
  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

  • 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

Use PostHog Analytics

Learn how to track events with PostHog analytics

Database Migrations

Learn how to run database migrations in production

On this page

Goal
Prerequisites
Steps
Connect to Vercel
Configure Environment Variables
Deploy
Configure Custom Domain (Optional)
Update Webhook URLs
Automatic Deployments
Common Issues
Build Fails
Environment Variables Not Working
Database Connection Fails
Next Steps
Related Documentation