Maintenance May 12, 8–9 PM PDT (May 13, 03:00–04:00 UTC). ~1 min disruption to sandbox management may occur. Already running sandboxes will not be affected. Questions? Contact us
Maintenance May 12, 8–9 PM PDT (May 13, 03:00–04:00 UTC). ~1 min disruption to sandbox management may occur. Already running sandboxes will not be affected. Questions? Contact us
Use this file to discover all available pages before exploring further.
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.
import { Volume, Sandbox } from 'e2b'const volume = await Volume.create('my-volume')// You can pass a Volume objectconst sandbox = await Sandbox.create({ volumeMounts: { '/mnt/my-data': volume, },})// Or pass the volume name directlyconst sandbox = await Sandbox.create({ volumeMounts: { '/mnt/my-data': 'my-volume', },})// Files written to /mnt/my-data inside the sandbox are persisted in the volumeawait sandbox.files.write('/mnt/my-data/hello.txt', 'Hello, world!')