Join our Discord Server
Collabnix Team The Collabnix Team is a diverse collective of Docker, Kubernetes, and IoT experts united by a passion for cloud-native technologies. With backgrounds spanning across DevOps, platform engineering, cloud architecture, and container orchestration, our contributors bring together decades of combined experience from various industries and technical domains.

Managing Docker Offload Cloud Sandboxes: Create, Pause, Resume, Resize and Delete

6 min read

Dark terminal window showing the command docker offload create --idle-timeout 30m with the title Managing Docker Offload Cloud Sandboxes

Docker Offload now runs your builds and containers inside a cloud sandbox: an isolated environment on Docker-managed hardware with its own Docker daemon. The new Manage Docker Offload sandboxes guide explains how that sandbox lives, pauses, resumes, and gets deleted. If docker ps ever returned an empty list unexpectedly, or a sandbox kept billing overnight, this is the page that explains why.

This post walks through that lifecycle step by step. Every command below comes from the official guide or the Docker CLI reference.

Prerequisites

According to the Docker Offload docs, you need the following before any of this works:

  • Docker Desktop 4.97 or later.
  • A Docker Agentic Platform subscription.
  • An authenticated Docker session (docker login).
  • An active internet connection, with no restrictive proxy or firewall blocking traffic to Docker Cloud.
  • The Enable Docker Offload setting turned off in Docker Desktop settings, if the setting appears at all.

That last point matters more than it looks. There are two versions of Docker Offload, and only one can be active at a time. When Enable Docker Offload is on, your commands use Docker Offload v1, where stopping a session removes the cloud environment and everything in it. When the setting is off or missing, you get the current sandbox-based version described here, where stopping only pauses the sandbox.

The mental model: one persistent sandbox per account

Before touching commands, it helps to understand three facts from the guide:

  • You use one Docker Offload cloud sandbox per account at a time.
  • The sandbox persists between sessions. Stopping it pauses it, and its containers, images, and volumes survive the pause.
  • You can connect to the same sandbox from more than one machine.

Think of it as a remote Docker host that Docker suspends when you are not using it. It also appears in the Docker Agentic Platform Console with a name that starts with offload-.

Step 1: Create and size the cloud sandbox

The entry point is docker offload create. Running it with no flags creates a sandbox and connects to it. If a sandbox already exists for your account, the command connects to that one instead of creating a second one, and resumes it if it is paused.

docker offload create

To choose the size and lifetime of a new sandbox, pass the sizing flags:

docker offload create --cpus 8 --memory 16g --ttl 4h

The CLI reference documents these options:

  • --cpus: number of CPUs for a new sandbox. Allowed values are 1, 2, 4, 8, or 16.
  • --memory: memory for a new sandbox, as a size such as 16g.
  • --ttl: how long the sandbox keeps running after your machine stops renewing it, as a duration such as 4h. The maximum is 24 hours.
  • --timeout: how long to wait for the sandbox to be ready. The default is 15m0s.

Here is the important detail: --cpus, --memory, and --ttl only apply when a sandbox is being created. If a sandbox is already running, they are ignored and docker offload create tells you so. To resize an existing sandbox you have to recreate it:

docker offload create --cpus 16 --memory 32g --recreate

Treat --recreate with care. It deletes the existing cloud sandbox and everything on it, including containers, images, and volumes. Push any images you care about to a registry before you resize.

Step 2: Inspect the sandbox with docker offload status

Use the status command to see what state the sandbox is in and why it is (or is not) about to pause:

docker offload status

The output has two groups. Sandbox shows the ID, state (running or paused), and creation time. This machine shows your connection state, session age, idle detection settings, and either a Time until idle countdown or a Kept awake by reason, such as a running container.

docker offload status does not wake a paused sandbox.

You can access Docker Agentic PLatform to see the Cloud Sandbox.

Step 3: Tune idle detection and time to live

Docker Offload pauses an idle sandbox so you are not billed for time you are not using. Two independent controls decide when that happens.

Idle timeout

The default idle timeout is 5 minutes. You can raise it:

docker offload create --idle-timeout 30m

Or turn idle detection off completely:

docker offload create --keep-alive

Rules from the guide and CLI reference worth remembering:

  • The minimum idle timeout is 1m and there is no maximum. A value of 0 behaves like --keep-alive. Values between 0 and 1m are rejected.
  • --keep-alive and --idle-timeout cannot be combined.
  • Either flag applies to a running sandbox immediately, without a restart.
  • Each machine remembers the idle timeout you last used for a sandbox, so you do not need to pass the flag every time. A brand new sandbox starts at 5m.
  • If idle_timeout is set in a config override file, it wins over both flags, and docker offload create tells you so.

With --keep-alive, the sandbox keeps running and billing until you run docker offload stop. It still pauses if your machine sleeps past the time to live, and after 24 hours.

What counts as activity

A sandbox is idle only when nothing is working inside it (no container or Docker daemon activity) and no command, build, or pull from your machine is in progress. An attached session or a forwarded port stops counting after a minute with no data flowing through it. A job that only waits on a remote call can look idle. On the other hand, a container on the host network or many running containers can keep the sandbox awake, so stop it when you are done.

Time to live

Idle detection runs on the connected machine, so it only works while that machine is awake and online. When your laptop sleeps or drops off the network, the time to live takes over. While a machine is connected, Docker Offload keeps renewing the TTL, so it only counts down once no machine is connected:

docker offload create --ttl 8h

The idle timeout covers an idle desk; the TTL covers a machine that has gone away.

Step 4: Stop, resume, and delete

To pause the sandbox:

docker offload stop

Your Docker context switches back to desktop-linux immediately, and the sandbox pauses in the background. Pausing can take several minutes, but billing stops as soon as the pause starts. Stopping pauses the sandbox for every machine on the account, not only the one where you ran the command.

While the sandbox is paused, docker ps and docker images list nothing, forwarded ports and file sync stop working, and attached or exec sessions end. Your data is still there. There is no explicit resume command. Any command that needs the sandbox or one of its containers resumes it, including docker run, docker start, docker exec, docker attach, docker logs, docker inspect, and docker offload create.

To delete the sandbox and everything on it, running or paused:

docker offload rm

The command asks for confirmation. To skip the prompt:

docker offload rm --force

Like stop, rm is account-wide: it deletes the sandbox for every machine. The next docker offload create builds a fresh sandbox with the default 5m idle timeout.

Step 5: Work across machines and mix local with cloud containers

Running docker offload create on a second machine connects to your existing sandbox, so both machines report the same account and sandbox ID. Each machine tracks its own session and runs its own idle detection, and they do not share that state. In practice, a laptop with a 5m timeout can pause the sandbox while your desktop is still using it. If you work from two machines, set the same idle timeout on both.

Creating a sandbox does not stop your local containers. It changes which daemon your commands reach. While the docker-cloud context is selected, docker ps -a shows only cloud containers, and images built locally are not present in the sandbox (and the other way round). To reach the local daemon without disconnecting:

docker --context desktop-linux ps -a
docker --context desktop-linux compose up

To send a single command to the cloud while your context stays local, use the global --cloud flag. It must come before the subcommand:

docker --cloud build .

If you place it after the subcommand, as in docker run --cloud, the CLI fails with an unknown flag error. --cloud creates a sandbox if you do not have one, and it never silently falls back to local execution if provisioning fails.

Published ports are forwarded to your machine and bind-mounted files are synced. Compose state also survives a pause: docker compose stop keeps containers and data, while docker compose down removes the containers.

How this fits Local Sandboxes vs Cloud Sandboxes

Docker uses “sandbox” in two related places. Docker Sandboxes, driven by the sbx CLI, give AI agents isolated environments that run either locally on your host or in the cloud. Docker Offload cloud sandboxes, covered here, run your regular docker builds and containers on Docker-managed hardware.

The Offload guide calls out one key difference. Offload forwards ports and syncs bind-mounted files back to your machine. When you use cloud sandboxes directly through the sbx CLI, there is no path back to your machine. The Compare local and cloud sandboxes page adds more detail on the sbx side: a local sandbox uses host resources, can mount host paths, and can use supported host hardware such as GPU or USB, while a cloud sandbox uses Docker-managed cloud resources, has no access to host paths or host hardware, and needs files transferred or a repository cloned inside it.

In short: pick a local sandbox when the agent needs your files or hardware, an sbx cloud sandbox when you want agents isolated from your machine, and Docker Offload when you want your normal Docker workflow on cloud hardware.

Troubleshooting tips

The Troubleshoot Docker Offload page covers the common cases:

  • Builds still run locally. Run docker offload status and docker context ls. If desktop-linux is selected, run docker offload create or use --cloud per command. If authentication looks off, run docker logout and then docker login.
  • Unknown –cloud flag. Move --cloud before the subcommand.
  • Containers are missing. Each context only lists its own containers. Use docker --context desktop-linux ps -a for local ones.
  • Containers disappeared. The sandbox is probably paused. Run a command that needs it, such as docker start or docker logs.
  • Paused mid-work. Raise --idle-timeout or use --keep-alive.
  • Stopped while your machine slept. Create with a longer --ttl.
  • Slow resume. A pause in progress must finish first. A fully paused sandbox resumes in under a minute.

Key takeaways

  • One Docker Offload cloud sandbox per account, shared by every machine you connect.
  • docker offload stop pauses and keeps data; docker offload rm deletes everything for all machines.
  • Sizing flags apply only at creation. Resizing needs --recreate, which wipes the sandbox.
  • Idle timeout (default 5m) handles idle sessions; TTL (max 24h) handles disconnected machines.
  • docker ps and docker offload status never wake a paused sandbox; docker start, logs, exec and friends do.
  • --cloud is a global flag and must come before the subcommand.

References

Source guide: Manage Docker Offload sandboxes. Related pages: docker offload create reference, docker offload stop, docker offload rm, Troubleshoot Docker Offload, Docker Offload usage, and Compare local and cloud sandboxes.

Have Queries? Join https://launchpass.com/collabnix

Collabnix Team The Collabnix Team is a diverse collective of Docker, Kubernetes, and IoT experts united by a passion for cloud-native technologies. With backgrounds spanning across DevOps, platform engineering, cloud architecture, and container orchestration, our contributors bring together decades of combined experience from various industries and technical domains.

Understanding AI Embeddings and Vector Search for Beginners

Explore the world of AI embeddings and vector search, learning how they transform massive data into actionable insights, driving intelligent systems.
Collabnix Team
9 min read
Join our Discord Server