Volumes
HYPR supports persistent volumes and bind mounts for data that survives VM restarts and removals.Volume Types
Named Volumes
Named volumes are managed by HYPR and stored in/var/lib/hypr/volumes/. They persist until explicitly removed.
Bind Mounts
Bind mounts map a host directory directly into a VM. Changes are immediately visible on both sides.Managing Volumes
Creating Volumes
Listing Volumes
Inspecting Volumes
Removing Volumes
Pruning Unused Volumes
Remove all volumes not attached to any running VM:Volumes in Compose
Named Volumes
Define volumes in the top-levelvolumes section:
- HYPR creates a volume named
<stack>_pgdata - Data persists across
hypr compose downandhypr compose up - Volume is removed only with
hypr volume rm
Bind Mounts
Map host directories into VMs:Multiple Volumes
Read-Only Volumes
Mount a volume as read-only:Volume Storage
Storage Location
| Volume Type | Location |
|---|---|
| Standalone volumes | /var/lib/hypr/volumes/local/<name> |
| Stack volumes | /var/lib/hypr/volumes/<stack>/<name> |
Naming Convention
Stack volumes are prefixed with the stack name:myproject and volume is pgdata, the full name is myproject_pgdata.
Direct Access
You can access volume data directly on the host:Use Cases
Database Persistence
Development with Hot Reload
Shared Data Between Services
Log Persistence
Backup and Restore
Backup a Volume
Restore a Volume
Copy Data Between Volumes
Troubleshooting
Volume Not Found
Permission Denied
If a VM cannot write to a volume:-
Check host directory permissions:
- Ensure the VM user has write access
Volume In Use
-
Stop the VM using the volume:
-
Or force remove:
Disk Space
Check volume sizes:Best Practices
- Use named volumes for databases - Ensures data survives container recreation
- Use bind mounts for development - Enables hot reload and easy editing
- Don’t store secrets in volumes - Use environment variables or secret management
- Regular backups - Volumes are not replicated automatically
-
Prune regularly - Remove unused volumes to reclaim disk space:
-
Name volumes descriptively - Use names like
postgres-datanotvol1