Skip to content

How-to guides

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.

2026 deprecation migration guide

Migrate away from Sandbox SDK features deprecated in June 2026.

Run background processes

Start and manage long-running services and applications.

Backup and restore

Create point-in-time backups and restore sandbox directories.

Browser terminals

Connect browser-based terminals to sandbox shells using xterm.js or raw WebSockets.

Use code interpreter

Execute Python and JavaScript code with rich outputs.

Run Docker-in-Docker

Run Docker commands inside a sandbox container.

Execute commands

Run commands with streaming output, error handling, and shell access.

Expose services

Create preview URLs and expose ports for web services.

Watch filesystem changes

Monitor files and directories in real-time to build responsive development tools and automation workflows.

Work with Git

Clone repositories, manage branches, and automate Git operations.

Manage files

Read, write, organize, and synchronize files in the sandbox.

Mount buckets

Mount S3-compatible object storage as local filesystems for persistent data storage.

Handle outbound traffic

Intercept and handle outbound HTTP from sandboxes using Workers.

Deploy to production

Set up custom domains for preview URLs in production.

Proxy requests to external APIs

Keep credentials secure by routing sandbox requests through a Worker proxy that injects authentication at request time.

Stream output

Handle real-time output from commands and processes.

WebSocket connections

Connect to WebSocket servers running in sandboxes.

Connect to Workers bindings

Access KV, R2, Durable Objects, and other bindings from a sandbox.