Render Deployment
Deploy Cortex to Render.
Render provides a simple platform for deploying Cortex with managed PostgreSQL.
Prerequisites
- A Render account
- A GitHub repository with Cortex code
- A Neon or external PostgreSQL database
Steps
1. Create a Web Service
- Log in to render.com
- Click New → Web Service
- Connect your GitHub repository
- Configure:
- Name:
cortex - Runtime:
Node - Build Command:
npm install && npm run build - Start Command:
npm run start
- Name:
2. Set Environment Variables
In the Render dashboard, go to Environment and add:
DATABASE_URL=your-neon-connection-string
AUTH_SECRET=generate-with-openssl-rand-base64-32
AUTH_URL=https://your-app.onrender.com
AUTH_GITHUB_ID=your-github-client-id
AUTH_GITHUB_SECRET=your-github-client-secret
OPENAI_API_KEY=sk-your-openai-key
NEXT_PUBLIC_APP_URL=https://your-app.onrender.com
NODE_ENV=production
3. Deploy
Click Create Web Service. Render will build and deploy your app.
4. Run Migrations
After deployment, open the Render shell and run:
npm run db:generate
npm run db:migrate
Custom Domain
- Go to Settings → Custom Domains
- Add your domain
- Update
AUTH_URLandNEXT_PUBLIC_APP_URLto match
Free Tier
| Feature | Limit |
|---|---|
| Runtime | 750 hours/month |
| Bandwidth | 100 GB/month |
| Build time | 500 minutes/month |
Render's free tier spins down after inactivity. For production, use a paid plan.
Troubleshooting
| Issue | Solution |
|---|---|
| Build fails | Check Node.js version (18+) |
| Database errors | Verify DATABASE_URL is correct |
| Auth not working | Ensure AUTH_URL matches your app URL |