Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion public/__redirects
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,15 @@
# Constellation
/constellation/ /workers-ai/ 301
# Containers
/containers/beta-info/ /containers/faq/ 301
/containers/image-management/ /containers/platform-details/image-management/ 301
/containers/scaling-and-routing/ /containers/platform-details/scaling-and-routing/ 301
/containers/architecture/ /containers/platform-details/architecture/ 301
/containers/durable-object-methods/ /containers/platform-details/durable-object-methods/ 301
/containers/container-package/ /containers/container-class/ 301
/containers/platform-details/ /containers/platform-details/architecture/ 301
# Sandbox
/sandbox/platform/beta-info/ /sandbox/platform/ 301
# D1
/d1/client-api/ /d1/worker-api/ 301
/d1/build-with-d1/d1-client-api/ /d1/worker-api/ 301
Expand Down Expand Up @@ -2675,4 +2678,3 @@
/changelog/2024-* /changelog/post/2024-:splat 301
/changelog/2025-* /changelog/post/2025-:splat 301
/changelog/2026-* /changelog/post/2026-:splat 301

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Containers and Sandboxes are now generally available
description: Containers and Sandbox SDK are now generally available on the Workers Paid plan.
products:
- containers
Comment thread
mikenomitch marked this conversation as resolved.
date: 2026-04-13
---

Cloudflare [Containers](/containers/) and [Sandboxes](/sandbox/) are now generally available.

Containers let you run more workloads on the Workers platform, including resource-intensive applications, different languages, and CLI tools that need full Linux environments.

Since the initial launch of Containers, there have been significant improvements to Containers' performance, stability, and feature set. Some highlights include:

- [Higher limits](/changelog/post/2026-02-25-higher-container-resource-limits/) allow you to run thousands of containers concurrently.
- [Active-CPU pricing](/changelog/post/2025-11-21-new-cpu-pricing/) means that you only pay for used CPU cycles.
- [Easy connections to Workers and other bindings](/changelog/post/2026-03-26-outbound-workers/) via hostnames help you extend your Containers with additional functionality.
- [Docker Hub support](/changelog/post/2026-03-24-docker-hub-images/) makes it easy to use your existing images and registries.
- [SSH support](/changelog/post/2026-03-12-ssh-support/) helps you access and debug issues in live containers.

The [Sandbox SDK](/sandbox/) provides isolated environments for running untrusted code securely, with a simple TypeScript API for executing commands, managing files, and exposing services. This makes it easier to secure and manage your agents at scale. Some additions since launch include:

- [Live preview URLs](/changelog/post/2025-08-05-sandbox-sdk-major-update/) so agents can run long-lived services and verify in-flight changes.
- [Persistent code interpreters](/changelog/post/2025-08-05-sandbox-sdk-major-update/) for Python, JavaScript, and TypeScript, with rich structured outputs.
- [Interactive PTY terminals](/changelog/post/2026-02-09-pty-terminal-support/) for real browser-based terminal access with multiple isolated shells per sandbox.
- [Backup and restore APIs](/changelog/post/2026-02-23-sandbox-backup-restore-api/) to snapshot a workspace and quickly restore an agent's coding session without repeating expensive setup steps.
- [Real-time filesystem watching](/changelog/post/2026-03-03-sandbox-watch-file-events/) so apps and agents can react immediately to file changes inside a sandbox.

For more information, refer to [Containers](/containers/) and [Sandbox SDK](/sandbox/) documentation.
75 changes: 0 additions & 75 deletions src/content/docs/containers/beta-info.mdx

This file was deleted.

5 changes: 2 additions & 3 deletions src/content/docs/containers/examples/container-backend.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ export default {
async fetch(request, env) {
const url = new URL(request.url);
if (url.pathname.startsWith("/api")) {
// note: "getRandom" to be replaced with latency-aware routing in the near future
const containerInstance = await getRandom(env.BACKEND, INSTANCE_COUNT);
return containerInstance.fetch(request);
}
Expand All @@ -161,8 +160,8 @@ export default {
```

:::note
This example uses the `getRandom` function, which is a temporary helper that will randomly
select of of N instances of a Container to route requests to.
This example uses `getRandom`, which randomly selects one of a fixed number of Container
instances for each request.

In the future, we will provide improved latency-aware load balancing and autoscaling.

Expand Down
5 changes: 2 additions & 3 deletions src/content/docs/containers/examples/stateless.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ class Backend extends Container {

export default {
async fetch(request: Request, env: Env): Promise<Response> {
// note: "getRandom" to be replaced with latency-aware routing in the near future
const containerInstance = await getRandom(env.BACKEND, INSTANCE_COUNT);
return containerInstance.fetch(request);
},
};
```

:::note
This example uses the `getRandom` function, which is a temporary helper that will randomly
select one of N instances of a Container to route requests to.
This example uses `getRandom`, which randomly selects one of a fixed number of Container
instances for each request.

In the future, we will provide improved latency-aware load balancing and autoscaling.

Expand Down
71 changes: 22 additions & 49 deletions src/content/docs/containers/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ sidebar:

import { Render, WranglerConfig } from "~/components";

Frequently Asked Questions:

## How do Container logs work?

To get logs in the Dashboard, including live tailing of logs, toggle `observability` to true
Expand Down Expand Up @@ -47,7 +45,7 @@ instance is running, any future requests will be routed to the initial location.
An Example:

- A user deploys a Container. Cloudflare automatically readies instances across its Network.
- A request is made from a client in Bariloche, Argentia. It reaches the Worker in
- A request is made from a client in Bariloche, Argentina. It reaches the Worker in
Cloudflare's location in Neuquen, Argentina.
- This Worker request calls `MY_CONTAINER.get("session-1337")` which brings up a Durable
Object, which then calls `this.ctx.container.start`.
Expand All @@ -68,7 +66,17 @@ See [rollout documentation](/containers/platform-details/rollouts/) for details.

## How does scaling work?

See [scaling & routing documentation](/containers/platform-details/scaling-and-routing/) for details.
Containers scale by creating or addressing specific instances. For stateless routing across a
fixed number of interchangeable instances, use the `getRandom` helper.

Refer to [scaling and routing](/containers/platform-details/scaling-and-routing/) for details.

### Is built-in autoscaling for stateless applications available?

Not today, though Cloudflare plans to add built-in autoscaling in a future release.

Until then, use `getRandom` for simple stateless routing and specific instance IDs when you need
explicit control over container lifecycle.

## What are cold starts? How fast are they?

Expand All @@ -80,7 +88,7 @@ this instance for the first time, it will result in a cold start.
This will start the container image from its entrypoint for the first time. Depending
on what this entrypoint does, it will take a variable amount of time to start.

Container cold starts can often be the 2-3 second range, but this is dependent
Container cold starts can often be in the 1-3 second range, but this is dependent
on image size and code execution time, among other factors.

## How do I use an existing container image?
Expand All @@ -92,8 +100,12 @@ See [image management documentation](/containers/platform-details/image-manageme
All disk is ephemeral. When a Container instance goes to sleep, the next time
it is started, it will have a fresh disk as defined by its container image.

Persistent disk is something the Cloudflare team is exploring in the future, but
is not slated for the near term.
Snapshots are coming soon, which allow the user to quickly persist and restore the disk
from an entire container or a directory.

You can also use [FUSE](/containers/examples/r2-fuse-mount/) to persist disk
to R2 or other object storage backends. Though you should not expect native
SSD-like performance while using FUSE.

## What happens if I run out of memory?

Expand All @@ -102,7 +114,7 @@ will be restarted.

Containers do not use swap memory.

## How long can instances run for? What happens when a host server is shutdown?
## How long can instances run for? What happens when a host server is shut down?

Cloudflare will not actively shut off a container instance after a specific amount of
time. If you do not set `sleepAfter` on your Container class, or stop the instance
Expand All @@ -120,28 +132,7 @@ will be rebooted elsewhere shortly after this.
You can use [Worker Secrets](/workers/configuration/secrets/) or the [Secrets Store](/secrets-store/integrations/workers/)
to define secrets for your Workers.

Then you can pass these secrets to your Container using the `envVars` property:

```javascript
class MyContainer extends Container {
defaultPort = 5000;
envVars = {
MY_SECRET: this.env.MY_SECRET,
};
}
```

Or when starting a Container instance on a Durable Object:

```javascript
this.ctx.container.start({
env: {
MY_SECRET: this.env.MY_SECRET,
},
});
```

See [the Env Vars and Secrets Example](/containers/examples/env-vars-and-secrets/) for details.
For implementation details, refer to [Environment variables and secrets](/containers/examples/env-vars-and-secrets/).

## Can I run Docker inside a container (Docker-in-Docker)?

Expand Down Expand Up @@ -176,22 +167,4 @@ For a complete working example, see the [Docker-in-Docker Containers example](ht

## How do I allow or disallow egress from my container?

When booting a Container, you can specify `enableInternet`, which will toggle
internet access on or off.

To disable it, configure it on your Container class:

```javascript
class MyContainer extends Container {
defaultPort = 7000;
enableInternet = false;
}
```

or when starting a Container instance on a Durable Object:

```javascript
this.ctx.container.start({
enableInternet: false,
});
```
Refer to [Handle outbound traffic](/containers/platform-details/outbound-traffic/) for how to control outbound traffic and internet access.
17 changes: 8 additions & 9 deletions src/content/docs/containers/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -241,29 +241,28 @@ This allows for multiple ways of using Containers:
Container instances.

:::note
Currently, routing requests to one of many interchangeable Container instances is accomplished
with the `getRandom` helper.
Today, routing requests to one of many interchangeable Container instances uses the
`getRandom` helper.

This is temporary — we plan to add native support for latency-aware autoscaling and load balancing in the coming months.
It randomly selects one of a fixed number of instances for each request.
:::

## View Containers in your Dashboard

The [Containers Dashboard](http://dash.cloudflare.com/?to=/:account/workers/containers) shows you helpful
The [Containers Dashboard](https://dash.cloudflare.com/?to=/:account/workers/containers) shows you helpful
information about your Containers, including:

- Status and Health
- Metrics
- Logs
- A link to associated Workers and Durable Objects

After launching your Worker, navigate to the Containers Dashboard
by clicking on "Containers" under "Workers & Pages" in your sidebar.
After launching your Worker, go to the Containers Dashboard by selecting
**Workers & Pages** > **Containers** in the dashboard sidebar.

## Next Steps

To do more:

- Modify the image by changing the Dockerfile and calling `wrangler deploy`
- Review our [examples](/containers/examples) for more inspiration
- Get [more information on the Containers Beta](/containers/beta-info)
- Review our [examples](/containers/examples/) for more inspiration
- Review the [Frequently Asked Questions](/containers/faq/) for current platform behavior and limitations
22 changes: 3 additions & 19 deletions src/content/docs/containers/index.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
title: Containers (Beta)
title: Containers
order: 0

pcx_content_type: overview
sidebar:
order: 1
badge:
text: Beta
head:
- tag: title
content: Overview
Expand All @@ -18,10 +16,8 @@ import {
Feature,
LinkTitleCard,
Plan,
RelatedProduct,
TabItem,
Tabs,
Badge,
WranglerConfig,
LinkButton,
} from "~/components";
Expand Down Expand Up @@ -136,14 +132,6 @@ regional placement, Workflow and Queue integrations, AI-generated code execution

<CardGrid>

<LinkTitleCard
title="Beta Information"
href="/containers/beta-info/"
icon="seti:shell"
>
Learn about the Containers Beta and upcoming features.
</LinkTitleCard>

<LinkTitleCard
title="Wrangler"
href="/workers/wrangler/commands/containers/#containers"
Expand All @@ -155,17 +143,13 @@ regional placement, Workflow and Queue integrations, AI-generated code execution

<LinkTitleCard
title="Limits"
href="/containers/platform-details/#limits"
href="/containers/platform-details/limits/"
icon="seti:lock"
>
Learn about what limits Containers have and how to work within them.
</LinkTitleCard>

<LinkTitleCard
title="SSH"
href="/containers/ssh/"
icon="seti:shell"
>
<LinkTitleCard title="SSH" href="/containers/ssh/" icon="seti:shell">
Connect to running Container instances with SSH through Wrangler.
</LinkTitleCard>

Expand Down
Loading
Loading