---
source: "https://browserpod.io/docs/reference/BrowserPod"
---

# ![BrowserPod](https://browserpod.io/docs/_astro/Logo_full_white.D7p0kGRJ_ZQGSuI.webp)

The BrowserPod class is the entry point to the API. An instance, called a Pod, is a microVM running in the browser tab.

`BrowserPod` is the main class and entry point of the BrowserPod API. An instance of `BrowserPod` is commonly called a **Pod**: a microVM running inside the browser tab. A Pod boots a Linux-like kernel with its own filesystem, processes and network, and runs Linux programs such as Node.js, git, bash and Rust binaries.

**“Isolated”** means each Pod is self-contained:

- Each Pod has its own filesystem
- Processes in one Pod cannot access another
- Everything runs client-side, without server-side execution

## Creating a Pod

Pods are created with the static [`boot`](https://browserpod.io/docs/reference/BrowserPod/boot.md) method. With an API key, the Pod boots on the Edge network:

```ts
const pod = await BrowserPod.boot({ apiKey: "..." });
```

Without one, it boots on the fetch network:

```ts
const pod = await BrowserPod.boot();
```

`boot` provisions the environment, allocates storage, and returns a ready-to-use Pod. Booting with an API key (on the Edge network) is charged per connected hour; booting without an API key (on the fetch network) is free. See [Networking](https://browserpod.io/docs/understanding-browserpod/networking.md) for details.

## Pod lifecycle

A Pod is created with [`BrowserPod.boot`](https://browserpod.io/docs/reference/BrowserPod/boot.md) and exists for the lifetime of the browser session. By default, Pods are **ephemeral**. Closing the tab starts a fresh environment.

To persist the filesystem across sessions, pass a `storageKey` to [`boot`](https://browserpod.io/docs/reference/BrowserPod/boot.md). Rebooting with the same key resumes the same disk:

```ts
const pod = await BrowserPod.boot({ apiKey: "...", storageKey: "my-project" });
```

## What can you do with a Pod?

### Run programs

Use [`run`](https://browserpod.io/docs/reference/BrowserPod/run.md) to execute a program. It returns a [Process](https://browserpod.io/docs/reference/Process.md) that resolves to the exit code when awaited:

```ts
const exitCode = await pod.run("node", ["script.js"], { terminal });
```

### Manage the filesystem

Create and read files with [`createFile`](https://browserpod.io/docs/reference/BrowserPod/createFile.md) and [`openFile`](https://browserpod.io/docs/reference/BrowserPod/openFile.md):

```ts
const file = await pod.createFile("/app/config.json", "utf-8");
await file.write('{ "debug": true }');
await file.close();
```

### Work with terminals

Attach an interactive terminal with [`createDefaultTerminal`](https://browserpod.io/docs/reference/BrowserPod/createDefaultTerminal.md):

```ts
const terminal = await pod.createDefaultTerminal(element);
```
