Skip to content

Volumes

View as Markdown

Volumes are FUSE-based mounts that provide shared file access across Daytona Sandboxes. They enable sandboxes to read from large files instantly - no need to upload files manually to each sandbox. Volume data is stored in an S3-compatible object store.

  • multiple volumes can be mounted to a single sandbox
  • a single volume can be mounted to multiple sandboxes

Create volumes

Daytona provides methods to create volumes using the Daytona Dashboard ↗ or programmatically using the Daytona Python, TypeScript, Ruby, Go SDKs, CLI, or API.

For persistent per-user, per-tenant, or per-workspace storage, use one shared volume per use case, environment, or project (for example a volume for staging and another for production), and set a dedicated subpath when you create each sandbox. The sandbox sees only that prefix inside the volume; it cannot access sibling subpaths.

This is the default pattern we recommend because it:

  • stays within the per-organization volume limits
  • avoids mounting a separate volume for every user or sandbox
  • continues to provide strong isolation at the mount boundary
  1. Navigate to Daytona Volumes ↗
  2. Click the Create Volume button
  3. Enter the volume name
daytona = Daytona()
volume = daytona.volume.create("my-awesome-volume")

For more information, see the Python SDK, TypeScript SDK, Ruby SDK, Go SDK, and API references:

volume.create (Python SDK)

volume.create (TypeScript SDK)

volume.create (Ruby SDK)

Volume.Create (Go SDK)

create volume (API)

Mount volumes

Daytona provides an option to mount a volume to a sandbox. Once a volume is created, it can be mounted to a sandbox by specifying it in the CreateSandboxFromSnapshotParams object. For per-user or multi-tenant data, pass subpath so only the specified folder inside the volume is visible at mount_path.

Mount the entire volume (omit subpath) when every sandbox that uses that volume should see the same tree, for example shared assets or single-tenant workloads.

Volume mount paths must meet the following requirements:

  • Must be absolute paths: mount paths must start with / (e.g., /home/daytona/volume)
  • Cannot be root directory: cannot mount to / or //
  • No relative path components: cannot contain /../, /./, or end with /.. or /.
  • No consecutive slashes: cannot contain multiple consecutive slashes like // (except at the beginning)
  • Cannot mount to system directories: the following system directories are prohibited: /proc, /sys, /dev, /boot, /etc, /bin, /sbin, /lib, /lib64
from daytona import CreateSandboxFromSnapshotParams, Daytona, VolumeMount
daytona = Daytona()
# Create a new volume or get an existing one
volume = daytona.volume.get("my-volume", create=True)
mount_dir = "/home/daytona/volume"
# Recommended for per-user / per-tenant data: one volume, unique subpath per sandbox
params = CreateSandboxFromSnapshotParams(
language="python",
volumes=[VolumeMount(volume_id=volume.id, mount_path=mount_dir, subpath="users/alice")],
)
sandbox = daytona.create(params)
# Entire volume at mount path (omit subpath) when all sandboxes should share the same tree
params_full = CreateSandboxFromSnapshotParams(
language="python",
volumes=[VolumeMount(volume_id=volume.id, mount_path=mount_dir)],
)
sandbox_shared = daytona.create(params_full)

For more information, see the Python SDK, TypeScript SDK, Ruby SDK, Go SDK, and API references:

CreateSandboxFromSnapshotParams (Python SDK)

CreateSandboxFromSnapshotParams (TypeScript SDK)

create (Ruby SDK)

Create (Go SDK)

create sandbox (API)

Work with volumes

Daytona provides an option to read from and write to the volume just like any other directory in the sandbox file system. Files written to the volume persist beyond the lifecycle of any individual sandbox.

The following snippet demonstrate how to read from and write to a volume:

# Write to a file in the mounted volume using the Sandbox file system API
sandbox.fs.upload_file(b"Hello from Daytona volume!", "/home/daytona/volume/example.txt")
# When you're done with the sandbox, you can remove it
# The volume will persist even after the sandbox is removed
sandbox.delete()

For more information, see the Python SDK, TypeScript SDK, Ruby SDK, and Go SDK references.

Get a volume by name

Daytona provides an option to get a volume by its name.

daytona = Daytona()
volume = daytona.volume.get("my-awesome-volume", create=True)
print(f"{volume.name} ({volume.id})")

For more information, see the Python SDK, TypeScript SDK, Ruby SDK, Go SDK, and API references:

volume.get (Python SDK)

volume.get (TypeScript SDK)

volume.get (Ruby SDK)

Volume.Get (Go SDK)

get volume by name (API)

List volumes

Daytona provides an option to list all volumes.

daytona = Daytona()
volumes = daytona.volume.list()
for volume in volumes:
print(f"{volume.name} ({volume.id})")

For more information, see the Python SDK, TypeScript SDK, Ruby SDK, Go SDK, and API references:

volume.list (Python SDK)

volume.list (TypeScript SDK)

volume.list (Ruby SDK)

Volume.List (Go SDK)

list volumes (API)

Delete volumes

Daytona provides an option to delete a volume. Deleted volumes cannot be recovered.

The following snippet demonstrate how to delete a volume:

volume = daytona.volume.get("my-volume", create=True)
daytona.volume.delete(volume)

For more information, see the Python SDK, TypeScript SDK, Ruby SDK, Go SDK, and API references:

volume.delete (Python SDK)

volume.delete (TypeScript SDK)

volume.delete (Ruby SDK)

Volume.Delete (Go SDK)

delete volume (API)

Limitations

Since volumes are FUSE-based mounts, they can not be used for applications that require block storage access (like database tables). Volumes are generally slower for both read and write operations compared to the local sandbox file system.

Pricing & Limits

Daytona Volumes are included at no additional cost. Each organization can create up to 100 volumes, and volume data does not count against your storage quota.

You can view your current volume usage in the Daytona Dashboard ↗.