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

  1. Log in to render.com
  2. Click NewWeb Service
  3. Connect your GitHub repository
  4. Configure:
    • Name: cortex
    • Runtime: Node
    • Build Command: npm install && npm run build
    • Start Command: npm run start

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

  1. Go to SettingsCustom Domains
  2. Add your domain
  3. Update AUTH_URL and NEXT_PUBLIC_APP_URL to match

Free Tier

FeatureLimit
Runtime750 hours/month
Bandwidth100 GB/month
Build time500 minutes/month

Render's free tier spins down after inactivity. For production, use a paid plan.

Troubleshooting

IssueSolution
Build failsCheck Node.js version (18+)
Database errorsVerify DATABASE_URL is correct
Auth not workingEnsure AUTH_URL matches your app URL