Pre-Deployment Checklist
Before deploying, ensure you have:- PostgreSQL database provisioned and accessible
- Redis instance (Upstash recommended) set up
- Blob storage configured (Vercel Blob or S3-compatible)
- All required environment variables ready
- OAuth applications created for integrations (GitHub, Google, etc.)
- Domain name configured (for production)
- SSL certificate (most platforms provide this automatically)
Forge uses Next.js 16 which requires Node.js v18 or later. Ensure your hosting platform supports this version.
Vercel
Vercel is the recommended platform for deploying Next.js applications and offers the simplest deployment experience.Create a new Vercel project
- Go to Vercel Dashboard
- Click “Add New” > “Project”
- Import your Git repository
- Vercel will automatically detect it’s a Next.js project
Configure environment variables
In the Vercel project settings, add all required environment variables:
NEXT_PUBLIC_APP_URL- Your production URL (e.g.,https://forge.yourdomain.com)BETTER_AUTH_SECRET- Generate withopenssl rand -base64 32BETTER_AUTH_URL- Same asNEXT_PUBLIC_APP_URLDATABASE_URI- Your PostgreSQL connection stringUPSTASH_REDIS_REST_URL- From Upstash dashboardUPSTASH_REDIS_REST_TOKEN- From Upstash dashboardBLOB_READ_WRITE_TOKEN- From Vercel Blob storage- Optional: OAuth credentials (GitHub, Google, Notion, Coinbase)
Set up Vercel Postgres (optional)
If you don’t have a PostgreSQL database yet:
- Go to your Vercel project > Storage
- Create a new Postgres database
- Vercel will automatically add the
DATABASE_URIenvironment variable
Set up Vercel Blob Storage
- Go to your Vercel project > Storage
- Create a new Blob store
- Vercel will automatically add the
BLOB_READ_WRITE_TOKENenvironment variable
Deploy
Click “Deploy” and Vercel will:
- Build your application
- Run the build process with React Compiler optimizations
- Deploy to a global CDN
- Provide you with a production URL
Railway
Railway provides an excellent platform for deploying full-stack applications with built-in PostgreSQL.Create a new Railway project
- Go to Railway
- Click “New Project”
- Select “Deploy from GitHub repo”
- Choose your Forge repository
Add PostgreSQL database
- Click “New” in your Railway project
- Select “Database” > “PostgreSQL”
- Railway will provision a database and provide connection details
Add Redis database
While Railway can provide Redis, Upstash is recommended for better reliability:
- Create a Redis database on Upstash
- Copy the REST URL and token
Configure environment variables
In your Railway service settings, add:
Railway provides
${{DATABASE_URL}} automatically when you add a PostgreSQL database. ${{RAILWAY_PUBLIC_DOMAIN}} is also automatically provided.Configure build settings
Railway should auto-detect Next.js. Verify these settings:
- Build Command:
npm run build - Start Command:
npm run start - Node Version: 18 or higher
Deploy
Railway will automatically deploy when you push to your main branch.Monitor the deployment in the Railway dashboard.
Docker
Deploy Forge using Docker for maximum portability.Manual VPS Deployment
Deploy on any VPS (DigitalOcean, Linode, AWS EC2, etc.) using PM2 for process management.Post-Deployment
Verify Installation
After deployment, check:- Application loads at your production URL
- Can create an account
- Can create dashboards and widgets
- OAuth integrations work (GitHub, Google, etc.)
- File uploads work (profile pictures)
- Real-time notifications work
Monitoring
Set up monitoring for:- Application logs - Check for errors
- Database connections - Monitor connection pool
- Redis - Track memory usage
- Uptime - Use services like UptimeRobot
- Performance - Use Vercel Analytics or Plausible
Backups
Ensure regular backups of:-
PostgreSQL database
- Environment variables - Store securely in a password manager
- Blob storage - Configure automatic backups on your storage platform
Updates
To update your Forge instance:Troubleshooting
Build Failures
Issue: Build fails with “Cannot find module” Solution: Clear cache and reinstall dependenciesDatabase Connection Issues
Issue: “Connection refused” or timeout errors Solution:- Verify
DATABASE_URIis correct - Check firewall rules allow connections
- Ensure database is running and accessible
- For cloud databases, whitelist your deployment IP
OAuth Callback Errors
Issue: “Redirect URI mismatch” Solution: Update OAuth app callback URLs to match production domain:- GitHub:
https://yourdomain.com/api/auth/callback/github - Google:
https://yourdomain.com/api/auth/callback/google - Notion:
https://yourdomain.com/api/auth/callback/notion
Performance Issues
Issue: Slow page loads Solution:- Enable Redis caching
- Check database query performance
- Optimize images (Next.js does this automatically)
- Use a CDN for static assets
- Monitor server resources (CPU, memory)
Next Steps
Environment Variables
Complete environment variable reference
Setup Guide
Initial setup and configuration