Overview
Volumes provide persistent, reusable storage that can be attached to sandboxes. Unlike sandbox filesystems that are ephemeral, volumes persist independently and can be mounted across multiple sandboxes, making them ideal for storing data, code, and configurations that need to outlive individual sandbox instances.What is a Volume?
A Daytona Volume is:- Persistent Storage: Data persists independently of sandbox lifecycle
- Reusable: Can be attached to multiple sandboxes (one at a time)
- S3-Backed: Stored in S3-compatible object storage for durability
- Mountable: Attached to sandboxes at specific mount paths
- Subpath Support: Mount only specific portions of a volume
Volumes are backed by S3-compatible storage and mounted into sandbox containers, providing both durability and performance.
Volume Structure
Every volume contains:Volume States
Volumes transition through the following states:Volume State Definitions
Volume State Definitions
Creating Volumes
Basic Volume Creation
- Python
- TypeScript
- Go
Creating with Sandbox
Create a volume and attach it to a sandbox in one operation:Mounting Volumes
Mount to Sandbox
Attach existing volumes to sandboxes:Multiple Mount Paths
Mount different volumes at different paths:Subpath Mounting
Mount only specific subdirectories within a volume:Subpath mounting is useful for isolating different projects or datasets within the same volume while maintaining a single storage resource.
Volume Management
Listing Volumes
Getting Volume Details
Deleting Volumes
Data Persistence Patterns
Workspace Persistence
Maintain project state across sandbox sessions:Data Pipeline Storage
Store intermediate results between pipeline stages:Configuration Management
Share configuration across multiple sandboxes:Use Cases
Machine Learning Datasets
Multi-Tenant Applications
Code Repository Cache
Best Practices
- Naming Convention: Use descriptive names that indicate the volume’s purpose
- Organization: Create separate volumes for different types of data (code, data, config)
- Cleanup: Regularly delete unused volumes to reduce storage costs
- Subpaths: Use subpath mounting for multi-tenant or multi-project volumes
- Backup: Important data should be backed up outside of volumes
- Access Patterns: Mount volumes read-only when data should not be modified
- Size Management: Monitor volume usage and clean up old data regularly
Volume vs Sandbox Filesystem
Use volumes for data that needs to persist or be shared. Use the sandbox filesystem for temporary computation and caching.
Performance Considerations
Volume Access Speed
Volumes are backed by S3, which has different performance characteristics than local disk:Concurrent Access
Volumes can only be mounted to one sandbox at a time:Next Steps
Sandboxes
Learn about creating and managing sandboxes
Snapshots
Understand pre-built environments
File Operations
Work with files in sandboxes and volumes
Getting Started
Start building with volumes