> ## 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

# Mounting volumes (/docs/volumes/mount)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 323 · updated: 2026-07-30 -->
Related: [Download data from volume](/docs/volumes/download.md), [Get information about a file or directory](/docs/volumes/info.md), [Managing volumes](/docs/volumes/manage.md), [Migrating data between volumes](/docs/volumes/migrate.md), [Read & write files](/docs/volumes/read-write.md), [Upload data to volume](/docs/volumes/upload.md)

> Mount one or more volumes to a sandbox at custom paths when creating it.

You can mount one or more volumes to a sandbox when creating it. The keys of the `volumeMounts` / `volume_mounts` object are the mount paths inside the sandbox.

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

const volume = await Volume.create('my-volume')

// You can pass a Volume object
const sandbox = await Sandbox.create({
  volumeMounts: {
    '/mnt/my-data': volume,
  },
})

// Or pass the volume name directly
const sandbox = await Sandbox.create({
  volumeMounts: {
    '/mnt/my-data': 'my-volume',
  },
})

// Files written to /mnt/my-data inside the sandbox are persisted in the volume
await sandbox.files.write('/mnt/my-data/hello.txt', 'Hello, world!')
```

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

volume = Volume.create('my-volume')

# You can pass a Volume object
sandbox = Sandbox.create(
    volume_mounts={
        '/mnt/my-data': volume,
    },
)

# Or pass the volume name directly
sandbox = Sandbox.create(
    volume_mounts={
        '/mnt/my-data': 'my-volume',
    },
)

# Files written to /mnt/my-data inside the sandbox are persisted in the volume
sandbox.files.write('/mnt/my-data/hello.txt', 'Hello, world!')
```
</CodeGroup>
