How-to guides

Last updated Sep 30, 2026 Note

This page documents Sandbox SDK 0.x for existing applications. For new applications, refer to Sandboxes on Cloudflare. To move an existing application to @cloudflare/sandbox 1.0, refer to Migrate from Sandbox SDK 0.x.

These guides show you how to solve specific problems and implement features with the Sandbox SDK. Each guide focuses on a particular task and provides practical, production-ready solutions.

Run background processes (Sandbox SDK 0.x) Start and manage long-running services and applications with the Sandbox SDK 0.x.

Backup and restore (Sandbox SDK 0.x) Snapshot a sandbox directory to R2 and restore it later with the Sandbox SDK 0.x.

Browser terminals (Sandbox SDK 0.x) Connect browser-based terminals to Sandbox SDK 0.x shells using xterm.js or raw WebSockets.

Use code interpreter (Sandbox SDK 0.x) Execute Python and JavaScript code with rich outputs using the Sandbox SDK 0.x code interpreter.

Deploy a Sandbox application (Sandbox SDK 0.x) Deploy a Sandbox SDK 0.x Worker and keep the npm package and container image on the same release line.

Run Docker-in-Docker (Sandbox SDK 0.x) Run Docker commands inside a Sandbox SDK 0.x container.

Execute commands (Sandbox SDK 0.x) Run commands with streaming output, error handling, and shell access in the Sandbox SDK 0.x.

Expose services (Sandbox SDK 0.x) Create preview URLs and expose ports for web services with the Sandbox SDK 0.x.

Watch filesystem changes (Sandbox SDK 0.x) Monitor files and directories in real time with the Sandbox SDK 0.x to build development tools and automation workflows.

Work with Git (Sandbox SDK 0.x) Clone repositories, manage branches, and automate Git operations with the Sandbox SDK 0.x.

Manage files (Sandbox SDK 0.x) Read, write, organize, and synchronize files in a sandbox with the Sandbox SDK 0.x.

Mount buckets (Sandbox SDK 0.x) Mount S3-compatible object storage as local filesystems with the Sandbox SDK 0.x.

Handle outbound traffic (Sandbox SDK 0.x) Intercept and handle outbound HTTP from Sandbox SDK 0.x sandboxes using Workers.

Configure preview URLs on a custom domain (Sandbox SDK 0.x) Set up wildcard DNS, routes, and TLS so Sandbox SDK 0.x exposePort preview URLs work on your domain.

Stream output (Sandbox SDK 0.x) Handle real-time output from commands and processes with the Sandbox SDK 0.x.

WebSocket connections (Sandbox SDK 0.x) Connect to WebSocket servers running in Sandbox SDK 0.x sandboxes.

Connect to Workers bindings (Sandbox SDK 0.x) Access KV, R2, Durable Objects, and other bindings from a Sandbox SDK 0.x sandbox.

Was this helpful?

YesNo

On this page

How-to guides - 图1Docs

{"@context":"https://schema.org","@type":"WebPage","@id":"https://developers.cloudflare.com/sandbox/sdk/guides/#page","headline":"How-to guides","description":"Practical guides for solving specific tasks with the Sandbox SDK 0.x.","url":"https://developers.cloudflare.com/sandbox/sdk/guides/","inLanguage":"en","image":"https://developers.cloudflare.com/sandbox/sdk/guides/og.png?v=1c45ebe13abdbb9d","dateModified":"2026-09-30","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Start and manage long-running services and applications with the Sandbox SDK 0.x. title: Run background processes image: https://developers.cloudflare.com/sandbox/sdk/guides/background-processes/og.png?v=e231bc0f3fb59dce


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/sandbox/llms.txt
Use this file to discover all available pages before exploring further.