wrangler links containers to Durable Object exports
Introduced 2026-08-18 · score 0.98
HOW TO USE IT
For a live `durable-object` export in `created` or `expecting-transfer` state, configure `storage: "sqlite"` and set `container` to an existing container’s `name`.
{"name":"my-worker","main":"worker.js","compatibility_date":"2026-07-01","containers":[{"name":"my-container","image":"./Dockerfile","max_instances":1}],"exports":{"MyContainerDO":{"type":"durable-object","storage":"sqlite","container":"my-container"}}}WHY THIS HELPS
Configure a container-backed Durable Object in a Worker.
BEFORE THIS CHANGE
The documented earlier linkage used `containers[].class_name` to name the Durable Object class.
REQUIREMENTS AND LIMITATIONS
- Version: 4.124.0
- exports.<Class>.type (required): Set to `"durable-object"` for a Durable Object class export.
- exports.<Class>.state: Lifecycle state; `created` is the default. `container` is allowed only for `created` or `expecting-transfer`.
- exports.<Class>.storage (required): For `created` or `expecting-transfer`, set to `"sqlite"` to use `container`.
- exports.<Class>.container: Name of an entry in the top-level `containers` array; requires SQLite storage.
- containers[].name (required): Container identifier; required when `class_name` is omitted so the export can reference it.
- containers[].image (required): Container image, such as a local Dockerfile path.
- containers[].max_instances: Maximum concurrent running container instances; defaults to 20.
- `container` is valid only on live `durable-object` exports in `created` or `expecting-transfer` state and requires `storage: "sqlite".
- The existing `containers[].class_name` direction remains supported; if both directions specify a relationship, they must agree.
- A container reference must name an existing container; two Durable Object exports cannot claim the same container; each container must link to a Durable Object; container names must be unique.
- A container's `class_name` cannot name a Durable Object whose storage is `legacy-kv`.
- Two containers cannot attach to the same Durable Object.
- Docs conflict: The current Containers configuration docs say to configure exactly one linkage direction. The release note says either direction may be used, provided both agree; follow the release note for the stated change. Current docs are dated Aug 28, 2026, after the card’s Aug 18, 2026 release.
FIRST-PARTY EVIDENCE
- https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.124.0
- https://developers.cloudflare.com/containers/reference/wrangler-configuration/
- https://developers.cloudflare.com/workers/wrangler/configuration/?ref=blog.cloudflare.com
Check the installed version and the source before using it. Entry JSON