docs/cloud/overview.mdx
microsandbox cloud runs your sandboxes on hosted infrastructure. The SDKs and the msb CLI are the same ones you use locally: the same builders, the same commands, the same code. Select the cloud backend and provide an API key; there is no daemon or separate client.
export MSB_BACKEND=cloud
export MSB_API_KEY="msb_..."
Everything from the quickstart works unchanged. With cloud selected and the API key exported, this creates a sandbox on cloud instead of your machine:
<CodeGroup> ```rust Rust use microsandbox::Sandbox;let sb = Sandbox::builder("hello") .image("python") .memory(512) .create() .await?;
let output = sb.exec("python", ["-c", "print('Hello from the cloud!')"]).await?; println!("{}", output.stdout()?);
sb.stop().await?;
```typescript TypeScript
import { Sandbox } from "microsandbox";
await using sb = await Sandbox.builder("hello")
.image("python")
.memory(512)
.create();
const output = await sb.exec("python", ["-c", "print('Hello from the cloud!')"]);
console.log(output.stdout());
from microsandbox import Sandbox
sb = await Sandbox.create("hello", image="python", memory=512)
output = await sb.exec("python", ["-c", "print('Hello from the cloud!')"])
print(output.stdout_text)
await sb.stop()
sb, err := m.CreateSandbox(ctx, "hello",
m.WithImage("python"),
m.WithMemory(512),
)
if err != nil {
return err
}
defer sb.Stop(ctx)
output, err := sb.Exec(ctx, "python", []string{"-c", "print('Hello from the cloud!')"})
fmt.Println(output.Stdout())
msb run python -- python3 -c "print('Hello from the cloud!')"
Hardware virtualization support on your machine is not needed for cloud sandboxes; msb doctor checks apply to the local runtime only.
The same key also authenticates the REST API directly, so you can manage sandboxes, volumes, and usage over plain HTTPS without an SDK. Command execution, file transfer, and SSH ride the sandbox command channel, which the SDKs and CLI handle for you.
msb ssh and SDK SSH clients you use locally.