Skip to main content

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

Output:

Listing Volumes

Output:

Inspecting Volumes

Output:

Removing Volumes

If the volume is in use:
Force remove:

Pruning Unused Volumes

Remove all volumes not attached to any running VM:
Output:
Skip confirmation:

Volumes in Compose

Named Volumes

Define volumes in the top-level volumes section:
When deployed:
  • HYPR creates a volume named <stack>_pgdata
  • Data persists across hypr compose down and hypr 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

Naming Convention

Stack volumes are prefixed with the stack name:
Example: If stack is 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

Solution: Check volume name and scope:
Stack volumes include the stack name prefix.

Permission Denied

If a VM cannot write to a volume:
  1. Check host directory permissions:
  2. Ensure the VM user has write access

Volume In Use

Solution:
  1. Stop the VM using the volume:
  2. Or force remove:

Disk Space

Check volume sizes:
View specific volume size:
Reclaim space:

Best Practices

  1. Use named volumes for databases - Ensures data survives container recreation
  2. Use bind mounts for development - Enables hot reload and easy editing
  3. Don’t store secrets in volumes - Use environment variables or secret management
  4. Regular backups - Volumes are not replicated automatically
  5. Prune regularly - Remove unused volumes to reclaim disk space:
  6. Name volumes descriptively - Use names like postgres-data not vol1