Cloudflare OS supports two local run modes. UseDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/cloudflare/cloudflare-os/llms.txt
Use this file to discover all available pages before exploring further.
pnpm run-local when you just want to try it out — it starts the entire stack as a single command in under a minute. Use the two-terminal dev mode when you’re actively developing, because it keeps the frontend hot-reload server running separately from the backend so UI changes appear instantly without a full rebuild.
Prerequisites
Before running locally you need:- Node.js v18 or later
- pnpm — install with
npm install -g pnpmor via the pnpm docs - No Cloudflare account required for local runs — everything uses the local
workerdruntime
Quick local run
pnpm run-local builds the frontend bundle, generates the format blueprints module, and starts all Workers (router, backend, and every discovered gatekeeper) under wrangler in a single process.
Open the app
Visit http://localhost:8787 in your browser and create your first account.
.wrangler subdirectory. Delete it to wipe state and start fresh.
pnpm run-local is not intended for production use. It runs the Workers runtime in development mode, which disables some platform-level security boundaries that production deployments rely on.Development mode (two terminals)
When you’re making changes to the frontend or backend, run the frontend Vite dev server and the wrangler backend server separately so that edits to React components and styles reload instantly.Terminal 1 — start the backend
run-dev-server.js, which generates wrangler.dev.jsonc files for all discovered gatekeeper packages and starts wrangler dev with every config in a single multi-worker process.Open the app
Visit http://localhost:3000. The frontend proxies API requests to the wrangler process on port 8787 automatically.
Configuring environment variables
Local configuration lives in a root-level.dev.vars file. This file is gitignored and is loaded automatically by pnpm dev-server — any KEY=VALUE line in it is injected into the wrangler process as an environment variable.
Create .dev.vars at the root of the repo (next to package.json):
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET and GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET (and their equivalents for other providers) are “shared” credentials — run-dev-server.js automatically seeds them into each matching gatekeeper Worker so you only need to set them once.
For the full list of supported variables, including AI Gateway billing options, see Configuration.
Gatekeeper credentials in local dev
Each gatekeeper Worker reads itsCLIENT_ID and CLIENT_SECRET from one of two places (in priority order):
- Per-package
.envfile — createpackages/gatekeeper-github/.env,packages/gatekeeper-google/.env, etc. withCLIENT_ID=andCLIENT_SECRET=lines. These files are gitignored. - Root
.dev.varsshared credentials —run-dev-server.jsreads the shared vars (e.g.GITHUB_CLIENT_ID/GITHUB_CLIENT_SECRET) and injects them into each gatekeeper’s generatedwrangler.dev.jsonc. The per-package.envtakes precedence if both are set.