Deploy Forge Cloud
Services to create
Section titled “Services to create”| Service | What to create | Environment variables |
|---|---|---|
| Neon | a project, with Neon Auth enabled | DATABASE_URL (pooled), NEON_AUTH_URL |
| Redis | a Redis 7+ database reachable over TCP | REDIS_URL |
| E2B | an API key | E2B_API_KEY |
| Deepgram | an API key | DEEPGRAM_API_KEY |
| Cloudflare R2 | a bucket and an S3 API token | R2_ACCOUNT_ID, R2_BUCKET, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY |
| Model upstreams | provider keys for the proxy | ANTHROPIC_API_KEY, optionally OPENROUTER_API_KEY and OPENAI_API_KEY |
| Relay | a long random secret shared with the relay | RELAY_SECRET |
Also set PUBLIC_URL, CONSOLE_URL, SITE_URL, RELAY_URL, CORS_ORIGINS and ADMIN_EMAILS, plus either
FORGE_TARBALL (an npm pack of Forge Code) or FORGE_INSTALL_SPEC, so sandboxes can install Forge Code.
- Run
npm install, thennpm run migratewithDATABASE_URLset. - Start the API (
npm start -w server) and the worker (npm run worker -w server) on a Node 22 host. - Deploy the relay:
cd relay, thennpx wrangler secret put RELAY_SECRETandnpx wrangler deploy. - Build and deploy the website and the console to Cloudflare Pages:
npm run build, thennpx wrangler pages deploy site/dist --project-name forge-siteandnpx wrangler pages deploy console/dist --project-name forge-console. SetVITE_API_URLandVITE_NEON_AUTH_URLwhen building the console. - In Forge Code, point at the API with
forge config set -g cloudUrl https://<your-api>.
Local development
Section titled “Local development”docker compose up -d starts Postgres, Redis and an S3-compatible store. Set DEV_AUTH_SECRET to sign in to the
console with any email instead of Neon Auth. It is for development only and is ignored when NODE_ENV=production.