Run your first sandbox
1
Install microsandbox
For application code, install the SDK for your language. For terminal workflows, use one of the CLI options above. These examples run locally without a cloud account or daemon. You can switch to our managed cloud when you need hosted compute.You can also provision the runtime with the CLI installer above or explicit SDK setup helpers. See Runtime setup for Node’s bundled binaries and Rust’s opt-out options.Check local virtualization support with:For platform-specific setup notes, see Linux troubleshooting, macOS troubleshooting, or Windows troubleshooting.
2
Run code in a sandbox
Create an ephemeral sandbox, execute code inside it, and stop it when finished. Ephemeral sandboxes are removed after stopping, so the example can reuse the same name.
hello, remove it with msb stop hello followed by msb rm hello on the same backend, or choose another name. Stopping a persistent sandbox retains it for later restart.
What just happened?
Here’s what the local runtime did when you created the sandbox:- Pulled the image from Docker Hub, unless it was already cached.
- Assembled a copy-on-write filesystem so changes inside the sandbox do not modify the base image.
- Booted a microVM as a child process with the resource limits you configured.
- Started the guest agent so the SDK can run commands and move data in and out.
exec call uses the host-guest command channel, not SSH and not the sandbox network.
Next steps
- SDK references: choose TypeScript, Rust, Python, Go, or Ruby for sandbox lifecycle and API details
- Protect API credentials: let sandboxed code use an API without receiving the credential value
- Browse guides: set up agents, CI/CD, Docker, and more
- Run on our managed cloud: choose a connection and keep your sandbox workflow
- Modify live sandbox settings: resize headroom, labels, secrets, and storage
- Troubleshoot Linux setup: KVM,
/dev/kvm, and permissions - Troubleshoot macOS setup: Apple Silicon and local runtime checks
- Troubleshoot Windows setup: WHP,
msb doctor, and runtime setup - Run commands and stream output:
exec,shell,attach, and streaming - Control network access: policies, DNS interception, and secret protection
- Manage sandboxes with the CLI: create, inspect, and manage sandboxes from the terminal