Self-hosting
Self-hosting guide
Run OpenVScan on your own Cloudflare account, what you deploy and what you need.
Self-hosting
Run OpenVScan on your own Cloudflare account, what you deploy and what you need.
OpenVScan runs entirely on Cloudflare. A self-hosted install is two Workers, one D1 database, one R2 bucket, a GitHub App that you register yourself and a WorkOS environment for sign-in. This page lists the pieces, what you need before you start, and the order to follow.
| Piece | Name | What it does |
|---|---|---|
| Web Worker | openvscan-web | Dashboard (TanStack Start), sign-in (WorkOS AuthKit), the GitHub webhook and install callback, encrypted storage of agent credentials, and the MCP server. Creates a run row for each review and hands it to the engine. |
| Engine Worker | openvscan-engine | Owns every review after it is created. Exposes the EngineApi RPC entrypoint to the web Worker. |
| Workflow | openvscan-review (class ReviewWorkflow) | The review pipeline, inside the engine: checkout, scanners, AI review, publish. Each step is durable and retried. |
| Durable Object + Container | ScanSandbox | One sandbox container per run. The image holds the scanners (OpenGrep and its curated rules, OSV-Scanner, Gitleaks, Trivy, zizmor, poutine, Spectral), Claude Code, Codex and the Cursor CLI. |
| Daytona (optional) | your Daytona account | Runs review sandboxes instead of Cloudflare Containers when you set DAYTONA_API_KEY. See Run sandboxes on Daytona. |
| Egress proxy | Outbound | A Worker entrypoint in the engine. The container has no direct internet access, and every HTTP(S) request it makes goes through this proxy. |
| D1 database | openvscan | Users and their linked GitHub accounts, installations, repositories, pull requests, runs, findings and encrypted credentials. Shared by both Workers. |
| R2 bucket | openvscan-artifacts | Raw scanner output and PR diffs. Shared by both Workers. |
| GitHub App | your choice | Receives pull request and check run events, and posts check runs, inline comments and the summary comment. Its OAuth client links users' GitHub accounts. |
| WorkOS | your WorkOS account | User management behind OpenVScan's sign-in pages: it keeps passwords, sends verification codes and reset emails, and runs GitHub sign-in. Its AuthKit domain also signs in MCP clients. |
pull_request webhook to the web Worker at /api/github/webhook.ENGINE.startRun(runId) over a service binding.ReviewWorkflow instance. The workflow boots a ScanSandbox container, clones the PR head through Outbound, runs the scanners and then the coding agent.The web Worker's service binding points at the engine by name, so the engine must be deployed first. Both Workers bind the same D1 database and R2 bucket.
wrangler deploy builds the container image from engine/container/Dockerfile and pushes it to Cloudflare.engines field in package.json.engines field says 8 or later, but the lockfile is format 9.0 and pnpm-workspace.yaml uses allowBuilds to approve dependency build scripts, so use a current release.openssl, or another way to generate random keys.https://openvscan-web.<your-subdomain>.workers.dev.Users of your deployment bring their own Claude, ChatGPT or Cursor subscription, or an Anthropic or OpenAI API key. You do not need a model provider account to run OpenVScan. See Agent credentials.
Several settings depend on the public URL of the web Worker: the GitHub App's callback, setup and webhook URLs, the redirect URIs in WorkOS, and the VITE_APP_URL and APP_URL variables. Decide it before you register the App. Either:
https://openvscan.example.com, which you attach to openvscan-web after the first deploy, orworkers.dev URL, https://openvscan-web.<your-subdomain>.workers.dev. Your workers.dev subdomain is shown in the Cloudflare dashboard under Workers & Pages.The examples in this guide use https://openvscan.example.com. Replace it with your origin everywhere.
OpenVScan has no license fee. Your costs come from the services it runs on:
SANDBOX_INSTANCE. Each run's sandbox is destroyed when the run ends.Check Cloudflare's current pricing pages for the numbers.
Follow these pages in order:
For working on OpenVScan itself, see Local development. To move to a newer version, see Upgrading.