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

# Managing volumes (/docs/volumes/manage)

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

> Create, connect to, list, inspect, and destroy volumes with the E2B SDK.

## Create a volume

<Note>Volume names can only contain letters, numbers, and hyphens.</Note>

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

const volume = await Volume.create('my-volume')
console.log(volume.volumeId) // Volume ID
console.log(volume.name)     // 'my-volume'
```

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

volume = Volume.create('my-volume')
print(volume.volume_id)  # Volume ID
print(volume.name)       # 'my-volume'
```
</CodeGroup>

## Connect to an existing volume

You can connect to an existing volume by its ID using the `connect()` method.

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

const volume = await Volume.connect('volume-id')
console.log(volume.volumeId) // Volume ID
console.log(volume.name)     // Volume name
```

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

volume = Volume.connect('volume-id')
print(volume.volume_id)  # Volume ID
print(volume.name)       # Volume name
```
</CodeGroup>

## List volumes

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

const volumes = await Volume.list()
console.log(volumes)
// [{ volumeId: '...', name: 'my-volume' }, ...]
```

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

volumes = Volume.list()
print(volumes)
# [VolumeInfo(volume_id='...', name='my-volume'), ...]
```
</CodeGroup>

## Get volume info

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

const info = await Volume.getInfo('volume-id')
console.log(info)
// { volumeId: '...', name: 'my-volume' }
```

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

info = Volume.get_info('volume-id')
print(info)
# VolumeInfo(volume_id='...', name='my-volume')
```
</CodeGroup>

## Destroy a volume

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

const success = await Volume.destroy('volume-id')
console.log(success) // true
```

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

success = Volume.destroy('volume-id')
print(success)  # True
```
</CodeGroup>
