Container Instances: Sizing, SSH, exec, and Scheduling Policy
How Cloudflare Containers instance types, account limits, SSH, exec(), scheduling, images, and pricing work in Wrangler.
This page summarises Cloudflare Containers documentation on choosing instance size, scaling within account limits, debugging with SSH and exec(), pulling images from external registries, and controlling behavior with scheduling policies and per-container observability.
Instance types: how to pick vCPU, memory, and disk
Section titled “Instance types: how to pick vCPU, memory, and disk”Container instance sizes match resources to your workload. You can use a predefined size or configure a custom one; larger sizes provide more CPU, memory, and disk.
Choose resources for your workload.
— Cloudflare, Container Fundamentals
For an application on the default scheduling policy, set size with the instance_type property in your Worker’s Wrangler configuration. On the durable_object policy, pass the named size to ctx.container.start() with the runtime instance property.
| Instance type | vCPU | Memory | Disk |
|---|---|---|---|
lite |
1/16 | 256 MiB | 2 GB |
basic |
1/4 | 1 GiB | 4 GB |
standard-1 |
1/2 | 4 GiB | 8 GB |
standard-2 |
1 | 6 GiB | 12 GB |
standard-3 |
2 | 8 GiB | 16 GB |
standard-4 |
4 | 12 GiB | 20 GB |
The dev and standard instance types remain for backward compatibility and are aliases for lite and standard-1, respectively. The standard-1 type now provides up to 8 GB of disk instead of only 4 GB.
New instance types provide up to 4 vCPU, 12 GiB of memory, and 20 GB of disk per container instance.
— Cloudflare, Larger Container instance types
Custom instance types in Wrangler configuration
Section titled “Custom instance types in Wrangler configuration”Custom instance types are enabled for all Cloudflare Containers users. Specify vcpu, memory_mib, and disk_mb instead of a named type:
{ "containers": [ { "image": "./Dockerfile", "instance_type": { "vcpu": 1, "memory_mib": 3072, "disk_mb": 4000 } } ]}Custom types in Wrangler apply only to the default scheduling policy. With durable_object, pass a custom instance object to ctx.container.start() instead. See Wrangler configuration and Scheduling Policies.
| Resource | Limit |
|---|---|
| Minimum vCPU | 1 |
| Maximum vCPU | 4 |
| Maximum memory | 12 GiB |
| Maximum disk | 20 GB |
| Memory to vCPU ratio | Minimum 3 GiB memory per vCPU |
For workloads needing less than 1 vCPU, use predefined types such as lite or basic. Individual custom limits are capped by the standard-4 profile (4 vCPU, 12 GiB memory, 20 GB disk).
Custom types no longer tie disk to memory: you can allocate up to the 20 GB disk maximum on any custom type. The maximum image size equals instance disk space, so more disk also allows larger images.
Containers custom instance types no longer limit disk based on memory.
— Cloudflare, Custom Container instance types no longer have a disk to memory ratio limit
Account limits: concurrent memory, vCPU, and disk
Section titled “Account limits: concurrent memory, vCPU, and disk”Per-account caps apply to concurrent live container instances:
| Resource | Limit |
|---|---|
| Concurrent memory | 6 TiB |
| Concurrent vCPU | 1,500 |
| Concurrent disk | 30 TB |
| Image size | Same as instance disk space |
| Total image storage per account | 50 GB |
You can now run more Containers concurrently with significantly higher limits on memory, vCPU, and disk.
— Cloudflare, Run 15x more Containers with higher resource limits
At these limits you can run, for example, 15,000 instances of lite, 6,000 of basic, over 1,500 of standard-1, or over 1,000 of standard-2 concurrently. See Limits and Instance Types for full constraints.
Images are limited in size by the disk of the configured instance type. Deleting images with wrangler containers images delete frees space, but reverting a Worker to a version that used a deleted image will error.
— Cloudflare, Image Management
durable_object scheduling policy: image and size at runtime
Section titled “durable_object scheduling policy: image and size at runtime”The durable_object scheduling policy (public beta) lets a Durable Object select the image and instance size at runtime instead of one central application configuration.
This policy lets a Durable Object select the image and instance size for a Container at runtime instead of using one centrally managed configuration for the application.
— Cloudflare, New scheduling policy for Containers
Configure the policy and named images in Wrangler; Wrangler exposes immutable references through ctx.container.images. Start the container with image and instance:
this.ctx.container.start({ image: this.ctx.container.images.base, enableInternet: false, instance: "standard-2",});At runtime, instance accepts lite, standard-1 through standard-4, or a custom object with vcpu, memoryMib, and diskMb (camel case). The runtime does not accept basic or legacy dev / standard aliases. If you omit instance, the container uses lite.
Durable Object–managed instances have independent lifecycles and do not join application-wide image rollouts. The policy also supports the Cloudflare-managed cloudflare/debian-trixie image (Node.js on Debian Trixie slim) without a named image in config. See Scheduling Policies and Migrate to the Durable Object scheduling policy.
Container images: Docker Hub and Google Artifact Registry
Section titled “Container images: Docker Hub and Google Artifact Registry”You can reference fully qualified images in Wrangler without pushing them to Cloudflare Registry first.
Docker Hub — use docker.io/<NAMESPACE>/<REPOSITORY>:<TAG>; private Hub images need separate credential setup.
Containers now support Docker Hub images. You can use a fully qualified Docker Hub image reference in your Wrangler configuration instead of first pushing the image to Cloudflare Registry.
— Cloudflare, Use Docker Hub images with Containers
Google Artifact Registry — after configuring credentials, use <REGION>-docker.pkg.dev/<PROJECT_ID>/<REPOSITORY>/<IMAGE>:<TAG>. Only *-docker.pkg.dev hosts are supported.
cat <PATH_TO_KEY> | npx wrangler containers registries configure <REGION>-docker.pkg.dev --gar-email=<SERVICE_ACCOUNT_EMAIL> --secret-name=<SECRET_NAME>Containers now support Google Artifact Registry images.
— Cloudflare, Use Google Artifact Registry images with Containers
See Image Management and container settings in Wrangler configuration.
exec(): run commands inside a running container
Section titled “exec(): run commands inside a running container”exec() starts processes inside a running container, streams stdin and stdout, inspects exit codes, and signals processes. Call it from a class extending Container, or from another Durable Object via this.ctx.container. The container must already be running.
Use this.ctx.container.exec() to start processes inside a running Container, stream standard input and output, inspect exit codes, and signal each process.
— Cloudflare, exec() is now available for Containers
The command array starts an executable directly—there is no implicit shell. For pipes, redirects, or variable expansion, invoke a shell explicitly (for example ["sh", "-c", "your pipeline"]). One RPC method can coordinate multiple exec() calls in a single caller-to-Durable Object round trip, including byte-oriented ReadableStream input and streamed output.
SSH through Wrangler: debug without a public port
Section titled “SSH through Wrangler: debug without a public port”SSH into running container instances through Wrangler for debugging, inspecting processes, or one-off commands. SSH does not expose a publicly accessible port; the only path is wrangler containers ssh, which authenticates against your Cloudflare account.
SSH does not expose a publicly accessible port on the Container. The only way to connect is through Wrangler with wrangler containers ssh, which authenticates against your Cloudflare account.
— Cloudflare, SSH
SSH through Wrangler is enabled by default (ssh.enabled defaults to true). You still need an ssh-ed25519 public key in authorized_keys before anyone can connect—enabling SSH alone does not grant access. Only ssh-ed25519 is supported. Set ssh.enabled to false to disable access completely.
Anyone with write access to a container can SSH when a matching public key is listed. SSH will not start a stopped container, and an active SSH session alone does not keep a container alive.
Find an instance ID and connect
Section titled “Find an instance ID and connect”List instances for an application (mirrors the dashboard instances view):
wrangler containers instances <APPLICATION_ID>Use --json for machine-readable output (default in non-interactive environments such as CI).
Connect interactively or run a single command:
wrangler containers ssh <INSTANCE_ID>wrangler containers ssh <INSTANCE_ID> -- ls -alwrangler containers ssh <INSTANCE_ID> --tty -- topFor OpenSSH as a proxy:
ssh -o ProxyCommand="wrangler containers ssh %h" cloudchamber@<INSTANCE_ID>When stdin and stdout are piped, Wrangler forwards data to the SSH server in the container; pass --stdio to force that mode. Configuration details: SSH, Wrangler configuration (SSH), and wrangler containers ssh.
Per-container observability and logging
Section titled “Per-container observability and logging”You can set observability per container application in Wrangler so logging changes for one container without affecting the rest of the Worker.
If you omit containers[].observability, Wrangler uses the top-level observability setting. A per-container block overrides the top-level value. Use target_instance_percentage or target_instance_count to apply changes to a subset of running instances.
This lets you change logging for one container without changing the rest of your Worker.
— Cloudflare, Configure observability per container application
Pricing: CPU by active usage, memory and disk by provisioned size
Section titled “Pricing: CPU by active usage, memory and disk by provisioned size”The instance type affects billable memory, disk, and CPU capacity. Larger types cost more for provisioned memory and disk and allow higher CPU spend based on active usage.
CPU time for Containers and Sandboxes is priced on active usage, not full provisioned vCPU for the whole period. At $0.00002 per vCPU-second, a standard-2 instance active for one hour at 20% average CPU utilization pays roughly 20% of the old provisioned-CPU charge. Memory and disk pricing still follow provisioned resources while the instance runs.
Containers and Sandboxes pricing for CPU time is now based on active usage only, instead of provisioned resources.
— Cloudflare, New CPU Pricing for Containers and Sandboxes
While an instance runs, memory and disk bill whether or not work happens inside; billing stops when the instance stops. See Pricing and Sandbox lifetime.
Local development: FUSE privileges with Miniflare
Section titled “Local development: FUSE privileges with Miniflare”Miniflare automatically grants local containers the Docker privileges needed for FUSE during wrangler dev, the Cloudflare Vite plugin, or direct Miniflare use.
Miniflare now automatically grants local Containers the Docker privileges required for Filesystem in Userspace (FUSE).
— Cloudflare, Use FUSE in local Containers development
FUSE privileges apply when the Docker daemon runs inside a VM (macOS, WSL) or on Linux rootless Docker when /dev/fuse is available. Rootful Docker on Linux does not support FUSE by default for local development; Miniflare does not grant FUSE when the daemon does not meet these conditions or cannot be inspected.
Common mistakes
Section titled “Common mistakes”- SSH to a stopped instance — SSH requires a running instance; it does not start one for you.
- Sub-vCPU custom types — custom
instance_typeneeds at least 1 vCPU; useliteorbasicfor smaller shares. - Shell features without a shell —
exec(["cmd", "arg"])does not run through/bin/sh; addsh -cwhen you need pipes or redirects. - Deleting registry images carelessly — freed space can break rollback to Worker versions that still reference deleted images.
- Assuming swap — memory pressure causes OOM restart, not swapping.
- Wrong field names by policy — Wrangler uses
memory_mib/disk_mb;ctx.container.start()custom objects usememoryMib/diskMb.
How to check this on your site
Section titled “How to check this on your site”- Confirm
instance_typeor runtimeinstancematches Limits and Instance Types for your scheduling policy. - Run
wrangler containers instances <APPLICATION_ID>(or--jsonin CI) and compare with the Cloudflare dashboard instances view linked from Containers. - With
authorized_keysconfigured, runwrangler containers ssh <INSTANCE_ID> -- ls -alon a running instance per SSH. - After deploy, spot-check billing impact of CPU utilization vs provisioned memory/disk using Pricing.
- You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about.