Cloud Platform Deployment
Deploy to Vercel, Netlify, Railway and other cloud platforms
Cloud platform deployment is the simplest method, suitable for quick launch and auto-scaling.
Vercel Deployment (Recommended)
1. Import Project
- Visit Vercel
- Click "Import Project"
- Select your GitHub repository
2. Configure Build
Root Directory: apps/next-app
Build Command: pnpm run build
Output Directory: .next
3. Configure Environment Variables
Add all necessary environment variables in Vercel project settings.
4. Deploy
Click Deploy, Vercel will automatically build and deploy.
Netlify Deployment
1. Create Site
- Visit Netlify
- Click "New site from Git"
- Select your repository
2. Configure Build
Base directory: apps/next-app
Build command: pnpm run build
Publish directory: .next
3. Add Netlify Plugin
# netlify.toml
[[plugins]]
package = "@netlify/plugin-nextjs"Railway Deployment
1. Create Project
- Visit Railway
- Click "New Project"
- Select "Deploy from GitHub repo"
2. Configure Service
Railway automatically detects Next.js projects and configures the build.
3. Add Database
Railway provides one-click PostgreSQL database addition.
Nuxt.js Deployment
Nuxt.js deployment steps are similar, just change root directory to apps/nuxt-app.
TanStack Start Deployment
TanStack Start deployment is similar as well. Use apps/tanstack-app as root directory and corresponding build command (for example pnpm build:tanstack).
Important Notes
- Ensure all environment variables are correctly configured. Copy
env.exampleto.envlocally; cloud hosts want the same keys in their dashboard. - Check the database connection string
- Update callback URLs (
APP_BASE_URL,BETTER_AUTH_URL) to the production domain - Verify webhook endpoints are reachable from the payment provider
Troubleshooting
| Symptom | What to check |
|---|---|
| Build cannot find workspace packages | Root install (pnpm install) and the correct app directory (apps/next-app, apps/nuxt-app, or apps/tanstack-app) |
| Auth or webhooks hit the wrong host | APP_BASE_URL and BETTER_AUTH_URL match the deployed URL, including https |
| Health check fails | GET /api/health on the deployed origin, and DATABASE_URL from the host's network |
| Edge or serverless timeouts | Long jobs (migrations, large uploads) belong in a worker or a traditional/Docker host, not the request path |