Overview
Learn how to deploy your applications.
You can deploy the app to any hosting provider that supports Node.js. Since Next.js is developed by Vercel, deploying to Vercel offers the most seamless and optimized developer experience.
Choose a hosting model
The starter kit ships as one Next.js service. It does not include a separately deployed API server or persistent worker process.
| Model | Good fit | You operate |
|---|---|---|
| Vercel or another serverless Next.js host | Automatic previews, managed scaling and the smallest operations surface | Environment variables, database migrations and provider configuration |
| A managed container platform | A portable image, longer-running requests and more runtime control | Image builds, health checks, scaling and release migrations |
| A self-hosted container or VPS | Infrastructure control and predictable host resources | TLS, reverse proxy, patching, restarts, monitoring, backups and capacity |
Choose based on the operations you are prepared to own, not only the initial deployment cost. If the product needs durable background work, use a managed background provider or operate a separate worker service. Do not depend on a Next.js web instance remaining alive after an HTTP response.
Keep release work separate from web startup
Apply committed database migrations once from CI or a one-off release task. Starting multiple web replicas must not race to apply the same migration.
Production checklist
Deployment readiness
Progress stays in this browser. It is not sent to Achromatic.
0 of 10 complete
Complete these steps before sending production traffic to a new environment:
-
Create an empty PostgreSQL database and set its production
DATABASE_URL. -
Add the required server and browser variables from the environment variable guide.
-
Replace the development
BETTER_AUTH_SECRETwith a unique production value. -
Add
https://yourdomain.com/api/auth/callback/googleto the Google OAuth client if Google sign-in is enabled. -
Configure the Stripe webhook endpoint at
https://yourdomain.com/api/webhooks/stripeif billing is enabled. -
Apply the committed database migrations once as a release step:
Terminalnpm run db:migrate -
Build the same revision that will be deployed:
Terminalnpm run build -
Verify sign-in, email delivery, organization access and one billing flow in the deployed environment before announcing the release.
Public launch checklist
A successful build only proves that the application compiled. Complete this second pass before directing customers to it:
- Connect the final domain, set
NEXT_PUBLIC_SITE_URLto its HTTPS URL and redeploy so generated links and authentication callbacks use that origin. - Replace the starter name, logo, contact details, legal text and sample marketing content with your own product information.
- Verify the sender domain and review the authentication and invitation email templates using real inboxes outside your company domain.
- Enable automated database backups and perform a restore rehearsal before the database contains customer data.
- Configure provider budgets and alerts for every usage-based service, including OpenAI, email, storage and monitoring.
- Test a failed payment, canceled subscription and Stripe webhook retry in test mode, not only a successful checkout.
- Confirm that a non-admin user cannot open admin routes or another organization's resources.
- Check the privacy policy and terms against the data and providers your deployed product actually uses.
Use a separate preview environment
Give preview deployments their own database and provider credentials. Never point an untrusted branch or pull request at the production database, Stripe account or billable AI project.
Control third-party spend
Treat every server-side provider key as access to a billable account. Use a separate provider project or account for each environment so a development or demo incident cannot consume the production budget.
For the included AI chat:
- Set an OpenAI project budget and provider-side usage alerts before adding
OPENAI_API_KEYto production. - Keep model selection restricted to the allowlist in
config/billing.config.ts. - Configure application credits deliberately. Organization credits limit what the product permits, but they do not replace the OpenAI project budget.
- Do not fund an unrestricted key for an anonymous public demo. Disable live generation or add a durable per-user and per-IP limiter first.
- Monitor provider usage after launch and keep a documented way to revoke the key quickly.
Request-frequency limiting is not included
The starter kits check organization credit balance before AI generation and deduct actual usage afterward. They do not ship a generic distributed request-frequency limiter. Add one backed by shared durable storage before exposing a billable endpoint to untrusted traffic.
Do not migrate from every replica
Run the migration command once in CI or as a one-off release task. Do not run it independently from every application container when several replicas may start at the same time.
To learn more about deployment, explore the following guide: