Going to Production
Deploy your SaaS application to production with confidence.
Deploying a MakerKit application to production requires configuring external services (database, storage, email, billing), setting environment variables, running database migrations, and deploying to a hosting platform. This guide provides the complete checklist and links to platform-specific deployment guides for Railway, Docker, or any Next.js-compatible host.
Prerequisites
Before deploying, you need these external services configured and ready:
- Database: A remote instance of your database. This can be self-hosted, or a managed provider (Supabase, Planetscale, Neon, Railway, etc.). You need a valid URL so you can push migrations to this instance.
- Migrations: Once you have a remote database, you need to push your application's migrations to set up its schema.
- Stripe and Billing: You need a set-up Stripe account, and you need to set up the Products and Prices with the correct Price IDs in the billing configuration.
- Email: You need to set up a valid email provider (ex. SMTP, Resend, etc.) to be able to send out emails.
- Storage: You need to set up a valid storage provider (ex. AWS S3, Cloudflare R2, etc.) to be able to store files.
- OAuth (optional): if you use any OAuth provider, you must set up valid credentials (ex. Google, GitHub, etc.). If you don't use any, you can skip this step.
If you don't have all the information above - you may not be able to deploy your application to production, so it's best to go back and sort out the information before you proceed.
Production Checklist
Before deploying to production, verify each item:
- ✅ Environment variables — All required variables set for your hosting platform (see Environment Setup)
- ✅ Database — Remote PostgreSQL instance provisioned with connection string
- ✅ Migrations — Schema deployed to production database via
prisma migrate deploy - ✅ Billing — Stripe/Polar account configured with products, prices, and webhook endpoint
- ✅ Storage — S3-compatible bucket configured for file uploads
- ✅ Email — Transactional email provider configured (Resend, Postmark, SendGrid)
- ✅ OAuth (if used) — Production credentials for Google, GitHub, or other providers
- ✅ Domain — Custom domain configured with SSL (automatic on most platforms)
Common Pitfalls
These issues cause most first-deployment failures:
NEXT_PUBLIC_*variables not set at build time — Environment variables prefixed withNEXT_PUBLIC_are embedded during the build, not at runtime. If you add them after building, redeploy.- Using Stripe test keys in production — Test keys (
sk_test_*) won't process real payments. Switch to live keys (sk_live_*) and update your webhook endpoint. - Missing webhook signature secret — Billing webhooks will fail signature validation without
STRIPE_WEBHOOK_SECRETor the equivalent for Polar. - Wrong
NEXT_PUBLIC_SITE_URL— Must match your actual domain exactly, includinghttps://. Authentication callbacks and emails use this URL. - Database SSL requirements — Most managed databases require SSL. If connections fail, check if your provider needs
?sslmode=requireappended toDATABASE_URL. - OAuth redirect URLs not updated — Social login will fail if your OAuth provider (Google, GitHub) doesn't have your production domain in the allowed redirect URLs.
Topics
- Environment Setup - Production environment variables
- Deployment - General deployment guidelines
- Railway - Deploy to Railway
- Docker - Deploy using Docker
Next: Deployment →