docs/getting-started/quickstart.mdx
curl -fsSL https://install.microsandbox.dev | sh
msb run debian
irm https://install.microsandbox.dev/windows | iex
msb run debian
Having trouble with a local installation? Choose your platform for setup checks and fixes.
<div className="msb-platform-strip msb-platform-strip-three" role="list" aria-label="Installation troubleshooting"> <a className="msb-platform-item msb-platform-link" role="listitem" href="/troubleshooting/linux"> <span className="msb-platform-icon"><Icon icon="linux" size={18} /></span> <span className="msb-platform-copy"><strong>Linux</strong><span>glibc 2.28+ and KVM</span></span> </a> <a className="msb-platform-item msb-platform-link" role="listitem" href="/troubleshooting/macos"> <span className="msb-platform-icon"><Icon icon="apple" size={18} /></span> <span className="msb-platform-copy"><strong>macOS</strong><span>Apple Silicon</span></span> </a> <a className="msb-platform-item msb-platform-link" role="listitem" href="/troubleshooting/windows"> <span className="msb-platform-icon"><Icon icon="windows" size={18} /></span> <span className="msb-platform-copy"><strong>Windows</strong><span>10+ · WHP</span></span> </a> </div> <Steps> <Step title="Install microsandbox"> For application code, install the SDK for your language. For terminal workflows, use one of the CLI options above. Both run microsandbox locally by default; there is no separate server or daemon to set up. The same installation also drives [microsandbox cloud](/cloud/overview) when an API key is set.<CodeGroup>
```bash TypeScript
npm install microsandbox
```
```bash Rust
cargo add microsandbox
```
```bash Python
pip install microsandbox
```
```bash Go
go get github.com/superradcompany/microsandbox/sdk/go
```
```bash Ruby
gem install microsandbox
```
</CodeGroup>
Check local virtualization support with:
```bash
msb doctor
```
For platform-specific setup notes, see [Linux troubleshooting](/troubleshooting/linux), [macOS troubleshooting](/troubleshooting/macos), or [Windows troubleshooting](/troubleshooting/windows).
<CodeGroup>
```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 a microVM!')"]);
console.log(output.stdout()); // Hello from a microVM!
```
```rust Rust
use microsandbox::Sandbox;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let sb = Sandbox::builder("hello")
.image("python")
.memory(512)
.create()
.await?;
let output = sb.exec("python", ["-c", "print('Hello from a microVM!')"]).await?;
println!("{}", output.stdout()?); // Hello from a microVM!
sb.stop().await?;
Ok(())
}
```
```python Python
import asyncio
from microsandbox import Sandbox
async def main():
sb = await Sandbox.create(
"hello",
image="python",
memory=512,
)
output = await sb.exec("python", ["-c", "print('Hello from a microVM!')"])
print(output.stdout_text) # Hello from a microVM!
await sb.stop()
asyncio.run(main())
```
```go Go
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 a microVM!')"})
if err != nil {
return err
}
fmt.Println(output.Stdout()) // Hello from a microVM!
```
```ruby Ruby
require "microsandbox"
Microsandbox.install unless Microsandbox.installed?
Microsandbox::Sandbox.with("hello", image: "python", memory: 512) do |sandbox|
output = sandbox.exec("python", ["-c", "print('Hello from a microVM!')"])
puts output.stdout
end
```
```bash CLI
msb run python -- python3 -c "print('Hello from a microVM!')"
```
</CodeGroup>
Here's what happened behind that Sandbox.builder(...).create() call:
The exec call uses the host-guest command channel, not SSH and not the sandbox network.
/dev/kvm, and permissionsmsb doctor, and runtime setupexec, shell, attach, and streaming