Features
- Ultra Fast Boot Times: Sandboxes cold boot in 1–3 seconds, even with dependencies included.
- Image Caching: Beam caches dependencies in your base image, so subsequent sandboxes boot faster. You can also build custom images for each app.
- Snapshots: Create Snapshots of the filesystem and restart Sandboxes from a previous state.
- Preview URLs: Dynamically expose ports behind SSL-terminated, authenticated endpoints.
- Session Management: Keep sandboxes running indefinitely, or configure them to shut down automatically after any period you choose.
Quick Start
Create a sandbox, run some code, and see the results:Running a Node.js server
You can run arbitrary code on Beam. It doesn’t need to be Python! For example, let’s run a Node server. We’ll track the startup time too:Core Features
Process Management
Run Python code, shell commands, or start long-running processes:File System Operations
Upload local files, download results, and manage your workspace:Dynamic Preview URLs
Expose ports to make your services accessible over the internet:Key Concepts
SandboxInstance
When you create a sandbox, you get aSandboxInstance class that provides:
process: Run commands and code with real-time outputfs: Upload, download, and manage filesexpose_port(): Make your services accessible to the internetterminate(): Cleanup when you’re done
Lifecycle
- Create: Configure your environment (CPU, memory, packages, etc.)
- Launch: Start the sandbox with
create() - Use: Execute code, manage files, expose services
- Terminate: Clean up with
terminate()(or let it auto-terminate)
What’s Next?
Now that you understand what Sandbox can do, let’s dive deeper into each capability:- Configuration: Learn how to customize your sandbox for different use cases
- Process Management: Master running code and commands with real-time feedback
- File System Operations: Upload, download, and manage files inside your Sandbox
- Networking: Deploy web services and expose them to the internet
- Examples: See real-world patterns and workflows