Diffinery

codician/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

64 lines · 6.3 KBRaw History
1---
2title: Self-hosting
3description: Diffinery is open source (Apache-2.0) and runs on your own Cloudflare account. What an instance needs, what it costs, the steps to deploy one, and where to go next.
4updated: 2026-10-25
5---
6
7Diffinery is open-source software under the Apache License 2.0, and the way to use it is to run your own instance on your own Cloudflare account and domain. There's no hosted service to sign up for: diffinery.com is the project's own instance. This page is the overview; [Deploy your own Diffinery](/docs/self-hosting/deploy) is the step-by-step guide.
8
9> **Want to try it before you deploy?** [Request early access](https://diffinery.com/early-access) to diffinery.com, the project's own instance. Its administrators review requests and email invitations; see [Early access](/docs/accounts/early-access).
10
11## Get the source
12
13The repository is [diffinery.com/codician/diffinery](https://diffinery.com/codician/diffinery), mirrored to [github.com/codician-team/diffinery](https://github.com/codician-team/diffinery). Clone either one; both carry the same `main` branch, with the `LICENSE` and `NOTICE` files at the top.
14
15```sh
16git clone https://github.com/codician-team/diffinery.git
17cd diffinery
18```
19
20## What an instance needs
21
22| Requirement | Why |
23| --- | --- |
24| A Cloudflare account on the Workers Paid plan, with R2 turned on | Diffinery uses Workers, Durable Objects with SQLite, D1, R2, Queues, Workflows, Cron Triggers, Email Sending and Containers. Containers need the paid plan. |
25| A domain added to that account | The instance's hostname, such as `git.example.com`, is served through a Workers route on that zone. |
26| A Cloudflare Zero Trust organization | Cloudflare Access guards `/auth/access`, the email sign-in the first administrator uses and that lets people recover a lost passkey. |
27| A clone of the repository and somewhere to run the deploy | Your own machine with Node.js 22, pnpm 10, `jq`, `curl`, `openssl` and Docker, for `scripts/setup.sh`; or the repository's Deploy workflow, on a forge with GitHub-compatible Actions. |
28
29People who use your instance don't need a Cloudflare account; only the deployment does. See [What you need](/docs/self-hosting/deploy#what-you-need) for the full list.
30
31## The steps
32
33The quickest way is `scripts/setup.sh` from a clone on your machine: one command checks your tools, API token and zone, then deploys, and running it again updates the instance.
34
351. [Create a Cloudflare API token](/docs/self-hosting/deploy#step-2-create-a-cloudflare-api-token) with the permissions the deploy needs.
362. [Choose your hostname and first administrators](/docs/self-hosting/deploy#step-1-choose-your-hostname-and-first-administrators): `DIFFINERY_DOMAIN` and `BOOTSTRAP_ADMINS`. You don't edit any code.
373. Run the deploy:
38
39 ```sh
40 CLOUDFLARE_API_TOKEN=... CLOUDFLARE_ACCOUNT_ID=... DIFFINERY_DOMAIN=git.example.com \
41 BOOTSTRAP_ADMINS=you@example.com scripts/setup.sh
42 ```
43
44 Add `--dry-run` first to check everything without changing anything. See [Deploy from your own machine](/docs/self-hosting/deploy#deploy-from-your-own-machine). To deploy from a workflow on every push instead, see [Run the Deploy workflow](/docs/self-hosting/deploy#step-4-run-the-deploy-workflow).
454. [Set up email sending](/docs/self-hosting/deploy#step-5-set-up-email-sending) and [DNS](/docs/self-hosting/deploy#step-6-dns).
465. [Sign in as the first administrator](/docs/self-hosting/deploy#step-7-sign-in-as-the-first-administrator) at `/auth/access`, add a passkey, and invite your team from **Settings → People and invitations**.
47
48The deploy creates whatever is missing in your account, applies the database migrations, uploads the Worker and builds the runner image, and every step is safe to repeat. To update later, bring your copy up to date with upstream and deploy again; see [Updating](/docs/self-hosting/deploy#updating).
49
50## What it costs
51
52Diffinery is free. Your instance's costs are your Cloudflare bill: the Workers Paid plan has "a minimum cost of $5 USD per month per account", plus usage above its allowances ([Workers pricing](https://developers.cloudflare.com/workers/platform/pricing/), checked October 25, 2026), and runner and sandbox containers are billed by the 10 ms while they run ([Containers pricing](https://developers.cloudflare.com/containers/pricing/), checked October 25, 2026). Diffinery starts a container only when a job starts and stops it when the job ends, and per-account [quotas](/docs/reference/limits#account-quotas), which you set, cap what each account can use.
53
54## After the first deploy
55
56- **Who can join.** An instance is invite-only by default. Set `SIGNUP=open` to let anyone create an account; see [SIGNUP](/docs/self-hosting/configuration#signup) and [Invitations](/docs/accounts/invitations).
57- **Limits.** Change the per-account quotas and the instance's hosted job limit with the `QUOTA_*` and `HOSTED_JOBS_LIMIT` variables; see [Configuration](/docs/self-hosting/configuration#worker-variables).
58- **Running it.** [Site administration](/docs/admin/site-administration) covers accounts, early access requests, contact messages, email and audits, and the [status page](/docs/self-hosting/status-page) shows whether each part of your instance works.
59- **Your team's tools.** The CLI, the Claude Code and Codex plugins, the MCP server and the editor extensions all work with your instance. People install the CLI from it and run `diffinery setup` with its URL, which signs them in and points git, gh, the Claude Code plugins and Codex at it: `curl -fsSL https://git.example.com/install | bash`, then `diffinery setup --url https://git.example.com`. AI apps connect to `https://git.example.com/mcp`. See [Claude Code](/docs/connect/claude-code#self-hosted-diffinery), [Codex](/docs/connect/codex#self-hosted-diffinery), [Clone in your editor](/docs/repositories/clone-in-your-editor) and [Clone in JetBrains IDEs](/docs/repositories/clone-in-jetbrains-ides).
60- **How it fits together.** [Architecture](/docs/self-hosting/architecture) maps each part of Diffinery to the Cloudflare product that runs it.
61
62## Get help and contribute
63
64Report bugs and send pull requests on [the GitHub mirror](https://github.com/codician-team/diffinery) or [the Diffinery repository](https://diffinery.com/codician/diffinery). Report security problems privately with the [report form](https://diffinery.com/security/report); see [Vulnerability disclosure](/docs/security/disclosure).