> ## Documentation Index
> Fetch the complete documentation index at: https://e2b.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://e2b.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://e2b.manicule.dev/api/mcp.
> Every agent surface: https://e2b.manicule.dev/.well-known/llms-manifest.json

# Archil (/docs/storage/archil)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 888 · updated: 2026-07-30 -->
Related: [Cloud buckets](/docs/storage/cloud-buckets.md), [OpenCode](/docs/agents/opencode.md)

> Mount Archil's elastic POSIX file system in your E2B sandbox for high-performance, shared access to S3, R2, and GCS object storage.

[Archil](https://archil.com) is an infinite, elastic, POSIX file system that automatically synchronizes to object storage like S3, R2, and GCS. Use Archil when you need to mount a bucket to your E2B sandbox but want higher out-of-the-box performance than `s3fs` or `gcsfuse` — it's a natural fit for parallel agents that share state.

Key properties:

* Shared SSD read and write caching in front of your object storage bucket for higher performance.
* Mounted as a regular POSIX directory, so any tool, script, or agent in the sandbox can use it.
* Scales to whatever your sandbox writes — you pay only for what you use.
* [Mountable by many sandboxes at once](https://docs.archil.com/concepts/shared-disks) for shared state across parallel agents.

## Build a template

Build a template with the `archil` CLI preinstalled. The Archil package depends on `libfuse2`, which is already preinstalled in the base image.

<CodeGroup>
```ts title="JavaScript & TypeScript"
const template = Template()
  .fromBaseImage()
  .runCmd("curl -fsSL https://archil.com/install | sh")
```

```python title="Python"
template = (
    Template()
    .from_base_image()
    .run_cmd("curl -fsSL https://archil.com/install | sh")
)
```
</CodeGroup>

## Mount the disk

At sandbox runtime, mount the disk with a [disk-scoped mount token](https://docs.archil.com/concepts/disk-users#disk-token-authorization) from the [Archil console](https://console.archil.com).

<CodeGroup isRunnable="false">
```js title="JavaScript & TypeScript"
import { Sandbox } from 'e2b'

const sandbox = await Sandbox.create('<your template id>')
await sandbox.commands.run('mkdir -p /home/user/archil', { user: 'root' })
await sandbox.commands.run(
  'archil mount <disk-name-or-id> /home/user/archil --region <region>',
  { user: 'root', envs: { ARCHIL_MOUNT_TOKEN: '<disk-token>' } }
)
await sandbox.commands.run('chown user:user /home/user/archil', { user: 'root' })
```

```python title="Python"
from e2b import Sandbox

sandbox = Sandbox.create("<your template id>")
sandbox.commands.run("mkdir -p /home/user/archil", user="root")
sandbox.commands.run(
    "archil mount <disk-name-or-id> /home/user/archil --region <region>",
    user="root",
    envs={"ARCHIL_MOUNT_TOKEN": "<disk-token>"},
)
sandbox.commands.run("chown user:user /home/user/archil", user="root")
```
</CodeGroup>

`<disk-name-or-id>` is either an owner-qualified name (`myorg/my-disk`) or a disk ID (`dsk-0123456789abcdef`); `<region>` is the disk's region (e.g. `aws-us-east-1`). The disk is now mounted at `/home/user/archil` as a regular POSIX directory — any tool, script, or agent in the sandbox can read and write through it.

## Unmount before killing the sandbox

Call `archil unmount` before tearing down the sandbox. It's best practice to release filesystem resources cleanly rather than letting the sandbox kill take them down.

<CodeGroup isRunnable="false">
```js title="JavaScript & TypeScript"
await sandbox.commands.run('archil unmount /home/user/archil', { user: 'root' })
await sandbox.kill()
```

```python title="Python"
sandbox.commands.run("archil unmount /home/user/archil", user="root")
sandbox.kill()
```
</CodeGroup>

## Sharing across sandboxes

The same disk can be mounted by multiple sandboxes concurrently. Add `--shared` to the mount command — see [Shared Disks](https://docs.archil.com/concepts/shared-disks) for the checkout-based concurrency model.
