{"slug": "self-host-workers-and-durable-objects-with-workerd-clustering", "title": "Self-host Workers and Durable Objects with workerd clustering", "summary": "Cloudflare released experimental multi-machine clustering for workerd, the open-source runtime behind Cloudflare Workers, letting multiple workerd instances share an object storage bucket such as Cloudflare R2, Amazon S3, or Google Cloud Storage and run Workers and Durable Objects on a customer's own infrastructure. workerd persists each Durable Object's SQLite database in the bucket and uses conditional writes to elect one leader per object without a consensus service, and it now reads wrangler.json and wrangler.jsonc directly so existing Workers projects run unchanged; clustering requires the --experimental flag and a cluster key of at least 32 bytes. The release also builds D1, R2, Workflows, Cron Triggers, Static Assets, and the Cache API into the single workerd binary as experimental services, while KV and Queues in a cluster still need a Cap'n Proto config.capnp.", "body_md": "## Self-host Workers and Durable Objects with workerd clustering (experimental)\n\nYou can now run [Workers](https://developers.cloudflare.com/workers/) and [Durable Objects](https://developers.cloudflare.com/durable-objects/) as a multi-machine cluster on your own infrastructure with [`workerd` ↗︎](https://github.com/cloudflare/workerd), the open-source runtime behind Cloudflare Workers. Until now, `workerd` was primarily for local development because it ran as a single instance and stored data only on a local disk. Now several `workerd` instances can form one cluster that shares an object storage bucket. Documentation is at [workerd.dev ↗︎](https://workerd.dev/).\n\n- **Your own infrastructure:** Run inside your VPC, Kubernetes cluster, or on-premises hardware, next to internal services or within data residency limits.\n- **Stateful AI agents:** Give each agent a Durable Object with SQLite memory and alarms. Idle agents are evicted from memory; their state stays in the bucket.\n- **Real-time apps:** Give each chat room or collaborative document its own SQLite database, without a shared database or message broker.\n- **Coordination:** Build locks, counters, and job schedulers, each a single Durable Object that every instance routes to.\n\nPoint multiple `workerd` instances at an object storage bucket that supports conditional writes — such as [Cloudflare R2](https://developers.cloudflare.com/r2/), Amazon S3, or Google Cloud Storage. `workerd` persists each [Durable Object](https://developers.cloudflare.com/durable-objects/) SQLite database in the bucket and uses conditional writes to choose one leader for each object, with no consensus service.\n\nAny instance can accept a request for any object and forward it to the object's leader. To add capacity, start another instance against the same bucket. When an instance stops or fails, another instance takes over its objects without losing acknowledged writes.\n\n`workerd` now reads `wrangler.json` and `wrangler.jsonc` directly, so an existing Workers project that uses only the [supported configuration keys ↗︎](https://workerd.dev/docs/cloudflare-compat/#wrangler-configuration) runs on your own machines unchanged. (Soon `workerd` will also read `worker.config.json`, using the schema that the `cf` command writes, in place of `wrangler.json`. Refer to [limitations ↗︎](https://workerd.dev/docs/limitations/) for other changes that are coming soon.)\n\n```\nnpx workerd serve .\nyarn workerd serve .\npnpm workerd serve .\n```\n\nFor Docker or Kubernetes, every `workerd` release publishes the `docker.io/cloudflare/workerd` image for `linux/amd64` and `linux/arm64`:\n\nThe image has no esbuild, so set `\"no_bundle\": true` and make `main` an ES module that is already bundled.\n\nPreviously, `workerd` natively supported only Workers and Durable Objects. You needed Miniflare and Wrangler to run projects that used D1, Workflows, and other services. Now more of the Cloudflare stack is built into the single `workerd` binary. Like the cluster support itself, these built-in services require `--experimental`. (In a cluster, KV and Queues still need a Cap'n Proto configuration, `config.capnp`; `wrangler.json` support is coming soon.)\n\n| Service | Status | Cluster support | \n|---|---|---|\n| [Workers](https://developers.cloudflare.com/workers/) | Supported | Yes | \n| [Durable Objects](https://developers.cloudflare.com/durable-objects/) | Supported | Yes | \n| [Durable Object Facets](https://developers.cloudflare.com/dynamic-workers/usage/durable-object-facets/) | Supported | Yes | \n| [D1](https://developers.cloudflare.com/d1/) | Experimental | Yes | \n| [R2](https://developers.cloudflare.com/r2/) | Experimental | Yes | \n| [Workflows](https://developers.cloudflare.com/workflows/) | Experimental | Yes | \n| [Cron Triggers](https://developers.cloudflare.com/workers/configuration/cron-triggers/) | Experimental | Yes | \n| [Static Assets](https://developers.cloudflare.com/workers/static-assets/) | Experimental | Yes | \n| [Cache API](https://developers.cloudflare.com/workers/runtime-apis/cache/) | Experimental | Yes | \n| [Rate Limits](https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/) | Experimental | Per-instance | \n| [KV](https://developers.cloudflare.com/kv/) | Experimental | Yes ( `config.capnp` ) | \n| [Queues](https://developers.cloudflare.com/queues/) | Experimental | Yes ( `config.capnp` ) | \n\nClustering requires `--experimental`. Start each instance with the same bucket and the same cluster key, at least 32 bytes, and its own cluster address:\n\nFor R2 or S3, also set `AWS_ENDPOINT_URL`, `AWS_ACCESS_KEY_ID`, and `AWS_SECRET_ACCESS_KEY`; refer to the [cluster guide ↗︎](https://workerd.dev/docs/cluster/#settings).\n\nA cluster is meant to run a single application whose code you trust. `workerd` is not a hardened sandbox. For details, refer to [security ↗︎](https://workerd.dev/docs/security/).\n\nWe're just getting started with `workerd` clustering; the purpose of this experimental release is to gather feedback. Please open issues in [github.com/cloudflare/workerd ↗︎](https://github.com/cloudflare/workerd/issues) as you encounter them.\n\nFor more information, refer to the [workerd documentation ↗︎](https://workerd.dev/docs/), including the [cluster guide ↗︎](https://workerd.dev/docs/cluster/), [Cloudflare compatibility ↗︎](https://workerd.dev/docs/cloudflare-compat/), [guarantees ↗︎](https://workerd.dev/docs/guarantees/), and [limitations ↗︎](https://workerd.dev/docs/limitations/).", "url": "https://wpnews.pro/news/self-host-workers-and-durable-objects-with-workerd-clustering", "canonical_source": "https://developers.cloudflare.com/changelog/post/2026-12-03-workerd-self-hosted-durable-objects/", "published_at": "2026-12-03 22:43:40+00:00", "updated_at": "2026-12-03 22:46:19.219575+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "ai-infrastructure", "mlops"], "entities": ["Cloudflare", "workerd", "Durable Objects", "Cloudflare Workers", "Cloudflare R2", "Amazon S3", "Google Cloud Storage", "D1"], "also_reported_by": [], "takeaway": "Point multiple workerd instances at one conditional-write-capable bucket (R2, S3, or GCS) with the same 32-byte-plus cluster key to run Workers and Durable Objects as a self-hosted cluster, and set \"no_bundle\": true with a pre-bundled ES module main when using the docker.io/cloudflare/workerd image.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/self-host-workers-and-durable-objects-with-workerd-clustering", "markdown": "https://wpnews.pro/news/self-host-workers-and-durable-objects-with-workerd-clustering.md", "text": "https://wpnews.pro/news/self-host-workers-and-durable-objects-with-workerd-clustering.txt", "jsonld": "https://wpnews.pro/news/self-host-workers-and-durable-objects-with-workerd-clustering.jsonld"}}