Volumes
Persistent storage that exists independently of sandboxes and can be mounted across multiple sandboxes.
Volumes are currently in private beta. If you’d like access, please reach out to us at support@e2b.dev.
Volumes provide persistent storage that exists independently of sandbox lifecycles. Data written to a volume persists even after a sandbox is shut down, and volumes can be mounted to multiple sandboxes over time.
One volume shared across multiple sandboxes
Each sandbox with its own volume
Standalone usage via SDK
When a volume is mounted to a sandbox, files can be read and written directly at the mount path. The SDK methods are meant to be used when the volume is not mounted to any sandbox.
With E2B SDK you can:
- Manage volumes.
- Mount volumes to sandboxes.
- Read and write files to a volume.
- Get file and directory metadata.
- Upload data to a volume.
- Download data from a volume.
Example
import { Volume, Sandbox } from 'e2b'
const volume = await Volume.create('my-volume')
const sandbox = await Sandbox.create({
volumeMounts: {
'/mnt/my-data': volume,
},
})Was this page helpful?Suggest editsRaise issue