Using Volumes
Create volumes and attach them to sandboxes.
This page covers the mechanics of working with volumes: creating and managing them, attaching them to sandboxes at create time, and sharing data between sandboxes. Volumes are managed through daytona.volume in the SDKs and the /volumes routes in the REST API; attachment happens as part of sandbox creation.
Creating a volume
Volumes are created with a name and an optional size, and are ready to attach immediately. Names must be 1–128 characters of [A-Za-z0-9._-] and unique within the project; size_gb defaults to 100 and can be 1–10,000 GiB. The only volume type in v1 is blockmount, which is also the default.
The most convenient SDK call is get-or-create, which fetches the volume by name and creates it if missing — idempotent setup code:
Attaching volumes to a sandbox
Volumes are attached at sandbox create time, each at an absolute mount_path inside the sandbox. Optionally, subpath mounts a subdirectory of the volume instead of its root — useful for giving a sandbox just one dataset out of a larger volume.
Note: the SDK mount field is
volume_id/volumeId(it accepts a volume id or name — the platform resolves it), while the raw REST field is named"volume".
Attachment rules the API enforces:
- At most 8 volumes per sandbox.
mount_pathmust be absolute, contain no.., and be unique among the sandbox's mounts.- Reserved paths are rejected:
/,/proc,/sys,/dev,/overlay,/mnt/scratch. - The volume must be in state
ready(a deleted or errored volume returns409 Conflict).
Remember that a sandbox created with volumes cold-boots, and cannot pause or fork in v1 — see the overview for the full interaction list.
Sharing data between sandboxes
Because commits happen in the background (~5-second cadence), data written by one sandbox becomes visible to newly attaching sandboxes shortly after it's written. A typical producer/consumer flow:
Concurrent writers to the same volume are merged per-file, last-change-wins; conflicts are recorded on the volume (visible on GET /volumes/:id) but never block anyone. Structure concurrent workloads so each writer owns its own files.
Managing volumes
List, inspect, and delete volumes by id or name:
Deletion is refused with 409 Conflict while any live sandbox has the volume attached — delete or stop those sandboxes first. After deletion the volume's name is freed for reuse; deleted volumes remain visible via include_deleted for auditing.
See also
- Volumes Overview — the model: local-first performance, merge semantics, durability.
- Object stores — mounting existing S3-compatible buckets instead.