Comprehensive guide for deploying your application to production
DO NOT upgrade any dependencies (Clerk, Stripe, Supabase, Plunk, etc.) when preparing for production deployment. Upgrading dependencies during production deployment can introduce breaking changes and cause deployment failures. Always test dependency upgrades in development first and only upgrade after reading official migration guides.
Once you’re happy with your application after testing locally, we can deploy it to production.
Purchase a Domain
You must purchase a domain before deploying to production. Services like Clerk and Stripe require a verified domain for production environments.
Choose a domain registrar:
Select a domain name that:
Purchase your domain with WHOIS privacy protection enabled
Configure your DNS settings (you’ll need this for the next steps)
Setup Production Database (Supabase)
Create a new production project in Supabase:
Securely store your production credentials:
NEXT_PUBLIC_SUPABASE_URL
NEXT_PUBLIC_SUPABASE_ANON_KEY
SUPABASE_SERVICE_ROLE_KEY
DATABASE_URL
(with pgbouncer)DIRECT_URL
(without pgbouncer)Migrate your schema to production:
Configure Production Clerk Instance
If you were building for an agency client, you would need to jump on a call and help them set this up for their Google Workspace account and add the relevant DNS records.
Create a production instance in Clerk:
Configure your production domain:
Configure Google OAuth:
Create a new webhook in Clerk:
Securely store your production API keys:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
CLERK_SECRET_KEY
CLERK_WEBHOOK_SECRET
Configure Stripe for real Payments
Create your production products and prices:
Create the same products/prices as in your test environment (you can copy them from the test environment)
Note the live product and price IDs
Switch from test mode to live mode
Configure webhook endpoints:
Securely store your production API keys
STRIPE_SECRET_KEY
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
NEXT_PUBLIC_STRIPE_PRICE_ID
(for each product)STRIPE_WEBHOOK_SECRET
Never mix test mode and live mode API keys. Always keep them completely separate.
Configure Email Service (Plunk)
Set up your production email templates in Plunk:
Configure sender domains and verification:
Securely store your production API key:
PLUNK_API_KEY
Using your custom domain for sending emails improves deliverability and prevents your emails from being marked as spam.
Configure Feedback Collection (UserJot)
Configure Analytics
Configure Customer Support
Deploy to Vercel
Create a new project in Vercel:
Configure project settings:
Set all environment variables:
Deploy your application:
Set up your custom domain:
Set Spending Caps:
Never commit sensitive environment variables to your repository. Always use Vercel’s environment variable system.
Post-Deployment Verification
Verify authentication flows:
Verify payment processing:
Verify email functionality:
Vercel takes care of most security concerns. However, you can still see our Security Guide for more recommendations
When you build with Sonnet 3.7 or Grok, you’ll usually have very performant React code. However, you can still see our Performance Guide for more recommendations and tooling to improve performance, if necessary.
Templates for these coming soon.