BrowserPod 3.0 runs Rust BrowserPod 3.0 runs unmodified Rust programs in the browser Announcement
Using a coding agent? Not sure where to start? Talk to us
Sign up for Edge Get an Edge API key, with 1,000 free hours Contact us Talk to the team

Real Rust, in the browser tab

Stock rustc and cargo compile unmodified Rust source for BrowserPod. Programs keep the standard library: they read and write files, make network requests, start subprocesses and run threads in parallel.

terminal on your machineRust
1# Install the BrowserPod Rust toolchain
2$ curl https://rt.browserpod.io/4.0.0/rust/install.sh \
3  | bash
4$ rustup override set browserpod-4.0.0
5
6# The program in the pod below
7$ cat src/main.rs
8use std::{env, thread};
9
10fn main() {
11    let who = env::args().nth(1);
12    let who = who.as_deref().unwrap_or("BrowserPod");
13    let t = thread::spawn(|| "a real thread");
14    println!("Hello, {who}, from {} πŸ‘‹", t.join().unwrap());
15}
16
17# Build it for the pod
18$ cargo build --release \
19  --target wasm32-browserpod-linux-musl
bashRust
Starting BrowserPod…

From cargo to a running pod

You need rustup on your machine. The install script adds a pinned nightly toolchain with the BrowserPod target.

  1. 1Install the toolchain

    Download and install the BrowserPod Rust toolchain.

    $ curl https://rt.browserpod.io/4.0.0/rust/install.sh | bash
  2. 2Set the override

    Point the project at the toolchain, or set the channel in rust-toolchain.toml.

    $ rustup override set browserpod-4.0.0
  3. 3Build

    The binary lands in target/wasm32-browserpod-linux-musl/release.

    $ cargo build --release \ --target wasm32-browserpod-linux-musl
  4. 4Run it in a pod

    Copy the binary into the pod, then start bash and run it.

    pod.run("bash", [], { terminal })

Copy it in and run it

Your web app serves the binary. The page copies it into the pod and opens bash, so the user can run it and keep going.

main.jsRust
1import { BrowserPod } from "@leaningtech/browserpod";
2
3const pod = await BrowserPod.boot();
4const el = document.getElementById("console");
5const terminal = await pod.createDefaultTerminal(el);
6
7// Copy the binary into the pod
8const file = await pod.createFile("/hello", "binary");
9const resp = await fetch("/hello");
10await file.write(await resp.arrayBuffer());
11await file.close();
12
13await pod.run("bash", [], { terminal });

Smaller binaries

Add a profile to Cargo.toml with link-time optimisation and size-first settings, then build with --profile release-small.

On macOS, install LLVM with Homebrew if your project has C dependencies, so clang can target WebAssembly.

Cargo.tomlrelease-small
1[profile.release-small]
2inherits = "release"
3lto = true
4codegen-units = 1
5opt-level = "z"
6strip = true

Real Rust projects, unchanged

These projects build for BrowserPod from their own source, from ripgrep at around 40,000 lines to Codex at over a million.

ripgrepFast recursive search
yarn zpmYarn 6, written in Rust
starshipShell prompt
jjVersion control
openai/codexCoding agent

Get started

Install BrowserPod from npm and boot your first pod.

$npm i @leaningtech/browserpod

Need public URLs, GitHub or TCP from a pod? Add an API key for BrowserPod Edge, free for 1,000 hours a month.Get an API key

Stay informed with BrowserPod news

BrowserCode: a browser-based coding playground, powered by WebAssemblyBrowserCode is a free, open source, fully client-side coding playground. Open a tab, pick a template, clone a repo or pick an agent and start building. No account, no installs, no servers, no setup. Ana GabySoftware Engineer @ Leaning TechnologiesBeyond WASI: Running any Rust application in the browser with BrowserPod 3.0BrowserPod can now run real Rust programs in the browser, compiled from unmodified source with stock rustc and cargo. Yuri IozzelliSenior Software Engineer @ Leaning TechnologiesA Linux-like kernel in a browser tab - deep dive in the BrowserPod architectureHow the BrowserPod kernel supports running many Linux applications concurrently in the browser using WebAssembly. Alessandro PignottiCTO @ Leaning TechnologiesBrowserPod 2.0: in-browser WebAssembly sandboxes. Run git, bash, node, python...BrowserPod 2.0 ships with a real bash shell, git, and core Linux utilities. Yuri IozzelliSenior Software Engineer @ Leaning TechnologiesBrowserPod: universal in-browser sandbox powered by Wasm (starting with Node.js)Stefano De Rossi, Alessandro PignottiCEO @ Leaning TechnologiesBrowserPod: WebAssembly in-browser code sandboxes for Node, Python, and RailsBrowserPod Beta is live: zero latency in-browser code sandboxes in WebAssembly for Node, Python and Rails. Alessandro Pignotti, Stefano De RossiCTO @ Leaning TechnologiesBrowserPod: In-browser full-stack environments for IDEs and Agents via WasmBrowserPod is a WebAssembly-based, client-side container that brings full-stack dev environments to the browser, ideal for web IDEs, docs, and AI agents.Alessandro Pignotti, Stefano De RossiCTO @ Leaning Technologies