Define Containers in the Wrangler configuration file for your Worker. Each Container is associated with a Durable Object class, which provides access to the Container at runtime.
A Container application requires a Container definition, a Durable Object binding, and a Durable Object migration:
{
"$schema": "./node_modules/wrangler/config-schema.json",
"name": "my-container-worker",
"main": "src/index.ts",
// Set this to today's date
"compatibility_date": "2026-08-28",
"containers": [
{
"class_name": "MyContainer",
"image": "./Dockerfile",
"max_instances": 10,
},
],
"durable_objects": {
"bindings": [
{
"name": "MY_CONTAINER",
"class_name": "MyContainer",
},
],
},
"migrations": [
{
"tag": "v1",
"new_sqlite_classes": ["MyContainer"],
},
],
}"$schema" = "./node_modules/wrangler/config-schema.json"
name = "my-container-worker"
main = "src/index.ts"
# Set this to today's date
compatibility_date = "2026-08-28"
[[containers]]
class_name = "MyContainer"
image = "./Dockerfile"
max_instances = 10
[[durable_objects.bindings]]
name = "MY_CONTAINER"
class_name = "MyContainer"
[[migrations]]
tag = "v1"
new_sqlite_classes = [ "MyContainer" ]The configuration uses three sections:
containersdefines the container image and associates it with a Durable Object class throughclass_name.durable_objects.bindingsmakes the Durable Object namespace available to Worker code. In this example, access it throughenv.MY_CONTAINER.migrationscreates the SQLite-backed Durable Object class. Usenew_sqlite_classes, notnew_classes, for a Container.
The class_name in all three sections must match the exported Durable Object class in your Worker.
The containers entry can also configure the instance type, maximum number of running instances, image build, placement constraints, rollouts, and SSH access.
For all available fields and values, refer to the Containers Wrangler configuration reference.
- Deploy Containers — Build the image and deploy the Worker.
- Scaling and Routing — Route requests and scale Container instances.
- Rollouts — Control how configuration changes reach running instances.
- Image management — Use local and remote container images.