Volume Management¶
Milkcrate provides built-in Docker volume management to store and share persistent data across your containerized applications.
Overview¶
Volumes are persistent storage for Docker containers that:
- Persist data even when containers are stopped or deleted and can thus store configuration files, databases, assets, and more
- Can be shared across multiple containers
- Support file uploads via drag-and-drop interface
Creating a Volume¶
- Navigate to the Admin Dashboard
- Click Manage Volumes button
- Click Create Volume
- Enter:
- Volume Name: A unique identifier (alphanumeric, hyphens, underscores)
- Description: Optional description of the volume's purpose
The system will create a Docker volume with the name milkcrate-vol-{volume_name}.
Uploading Files to a Volume¶
Once a volume is created, you can upload files to it:
Using the Web Interface¶
- Navigate to Manage Volumes
- Click on a volume to view its details
- Use the drag-and-drop upload area to upload files:
- Drag files directly onto the upload zone
- Or click to browse and select files
- Click Upload File to complete the upload
Supported Upload Types¶
- Individual files: Upload any file type
- ZIP archives: Automatically extracted into the volume
Mounting Volumes to Containers¶
When deploying an application, you can mount volumes to make their contents accessible to your containers:
During Deployment¶
- Navigate to Deploy New App
- Fill in application details (name, route)
- In the Mount Volumes section:
- Check the volumes you want to mount
- Specify the mount path (e.g.,
/data,/config)
- Upload your application ZIP
- Click Deploy Application
Volume Mount Example¶
If you have a volume named app-config containing configuration files, you can:
- Create the volume
- Upload
config.jsonto the volume - When deploying your app, mount the volume to
/config - Your application can access the file at
/config/config.json
Managing Volumes¶
Viewing Volume Contents¶
- Navigate to Manage Volumes
- Click on a volume name
- View the list of files with their sizes and paths
Deleting a Volume¶
- Navigate to Manage Volumes
- Click the Delete (trash) icon for the volume
- Confirm the deletion
Warning: Deleting a volume permanently removes all files. Ensure no running containers are using the volume.
Use Cases¶
Configuration Files¶
Store application configuration that doesn't change with deployments:
Shared Data¶
Share data between multiple containers:
- Upload shared libraries
- Store common assets
- Maintain shared databases
Persistent Storage¶
Store data that must persist across container restarts:
- User uploads
- SQLite databases
- Log files
- Cache data
Technical Details¶
Docker Volume Naming¶
Milkcrate creates volumes with the prefix milkcrate-vol- followed by your volume name:
- Volume name:
my-data - Docker volume:
milkcrate-vol-my-data
Volume Permissions¶
Files in volumes are accessible by containers with read-write permissions (rw mode).
File Upload Implementation¶
Milkcrate uses temporary Alpine containers to copy files into volumes:
- A temporary container is created with the volume mounted
- Files are copied via Docker's
put_archiveAPI - The temporary container is removed
Best Practices¶
- Organize volumes by purpose: Create separate volumes for configs, data, and logs
- Document mount paths: Use consistent paths like
/data,/config,/logs - Use descriptive names: Name volumes based on their content (e.g.,
postgres-data,nginx-config)
Troubleshooting¶
Upload Fails¶
- Check available disk space
- Verify ZIP files are not corrupted
- Ensure the volume exists in Docker (
docker volume ls)
Container Can't Access Volume¶
- Verify the volume is mounted during deployment
- Check the mount path in your application code
- Ensure the container has proper permissions
- Verify the container name (may have
milkcrate-volprefix)
Volume Not Listed¶
- Refresh the volumes page
- Check if the volume exists:
docker volume ls | grep milkcrate-vol
API Reference¶
Volumes can also be managed via the API endpoints:
GET /admin/volumes/api/list- List all volumes
Next Steps¶
- Learn about Routing