Overview

Volumes

Volumes are in private beta — ask at support@e2b.dev. Known limits today: file locking, performance with many small files, and file ownership.

Three ways to use one#

Shared — One volume mounted into many sandboxes: a dataset, a cache, a model.
Dedicated — One volume per sandbox, so a user's workspace survives across sessions.
Standalone — No sandbox at all: upload and download through the SDK.

Create and mount#

import { Volume, Sandbox } from 'e2b'
 
const volume = await Volume.create('my-volume')
 
const sandbox = await Sandbox.create({
  volumeMounts: {
    '/mnt/my-data': volume,
  },
})
from e2b import Volume, Sandbox
 
volume = Volume.create('my-volume')
 
sandbox = Sandbox.create(
    volume_mounts={
        '/mnt/my-data': volume,
    },
)

Inside the sandbox the files are plain files at /mnt/my-data. Outside it, the SDK manages, reads, writes, uploads and downloads — see E2B's volume guides.

Next#

Updated

Was this page helpful?