Deployment Options
The Next.js SaaS Starter is designed to work seamlessly with modern hosting platforms that support Next.js applications:Vercel (Recommended)
Vercel is the recommended deployment platform as it’s built by the creators of Next.js and offers:- Zero-configuration deployments
- Automatic HTTPS and SSL certificates
- Global CDN and edge network
- Automatic preview deployments for pull requests
- Built-in environment variable management
- Excellent Next.js optimization
The official demo at next-saas-start.vercel.app is deployed on Vercel.
Other Platforms
You can also deploy to other platforms that support Next.js:- AWS (using Amplify, ECS, or EC2)
- Google Cloud Platform (using Cloud Run or App Engine)
- Azure (using App Service)
- DigitalOcean (using App Platform)
- Railway
- Render
Pre-Deployment Checklist
Before deploying your application, ensure you’ve completed the following steps:Environment Variables
Verify all required environment variables are configured:
BASE_URL- Your production domainPOSTGRES_URL- Production database connection stringSTRIPE_SECRET_KEY- Production Stripe secret keySTRIPE_WEBHOOK_SECRET- Production webhook secretAUTH_SECRET- Secure random string for JWT signing
Database Setup
Ensure your production database is ready:
- Database is created and accessible
- Connection string is secure (use SSL if available)
- Run migrations:
pnpm db:migrate - Optionally seed with initial data:
pnpm db:seed
Stripe Configuration
Switch from test mode to production mode:
- Use production API keys from Stripe Dashboard
- Create production webhook endpoint
- Configure webhook to listen for required events
- Test payment flow with real card (then refund)
Build Verification
Test the production build locally:Verify there are no build errors or TypeScript issues.
Environment Setup Overview
Required Environment Variables
The application requires five essential environment variables to function:.env
Database Considerations
- The application uses PostgreSQL with Drizzle ORM
- Supports any PostgreSQL-compatible database (Vercel Postgres, Neon, Supabase, etc.)
- Migrations are stored in
lib/db/migrations/ - Schema is defined in
lib/db/schema.ts
Stripe Webhook Configuration
The application requires a webhook endpoint to handle subscription changes:- Endpoint URL:
https://yourdomain.com/api/stripe/webhook - Required Events:
customer.subscription.updatedcustomer.subscription.deleted
app/api/stripe/webhook/route.ts:23-28.
Next Steps
Deploy to Vercel
Follow our step-by-step guide to deploy on Vercel
Production Setup
Configure production environment variables and webhooks