Storage & Volumes
Configure persistent storage for your containers
Storage & Volumes
Containers are ephemeral by default—data is lost when the container restarts. Use volumes and mounts to persist data across deployments.
Overview
Senate supports multiple storage types:
| Type | Description | Use Case |
|---|---|---|
| Volume | Docker-managed storage | Databases, file uploads |
| Bind Mount | Host directory mount | Development, shared files |
| File Mount | Single file injection | Config files, certificates |
Docker Services
For Docker services, configure storage in the Storage tab.
Adding a Mount
- Navigate to your service
- Go to the Storage tab
- Click Add Mount
- Configure the mount:

Volume Mount
Docker-managed named volumes:
| Field | Description | Example |
|---|---|---|
| Type | Select "Volume" | volume |
| Source | Volume name | myapp-data |
| Destination | Container path | /app/data |
| Read Only | Optional read-only mode | false |
# Creates a volume named "myapp-data" mounted at /app/data
Type: volume
Source: myapp-data
Destination: /app/dataVolumes are automatically created if they don't exist. Data persists even if the container is deleted.
Bind Mount
Mount a host directory into the container:
| Field | Description | Example |
|---|---|---|
| Type | Select "Bind" | bind |
| Source | Host path | /host/data |
| Destination | Container path | /app/data |
| Read Only | Optional | false |
# Mounts host directory /host/data to container /app/data
Type: bind
Source: /host/data
Destination: /app/dataBind mounts expose host filesystem to the container. Use with caution in production.
File Mount
Inject a single file into the container:
| Field | Description | Example |
|---|---|---|
| Type | Select "File" | file |
| Destination | Container file path | /app/config.json |
| Content | File contents | {"key": "value"} |
# Creates /app/config.json with specified content
Type: file
Destination: /app/config.json
Content: {"debug": false, "port": 3000}Use cases:
- Configuration files
- SSL certificates
- Custom scripts
- Nginx configs
Compose Services
For Compose services, storage is defined in your docker-compose.yml:
services:
app:
volumes:
- app-data:/app/data # Named volume
- ./config:/app/config:ro # Bind mount (read-only)
volumes:
app-data:The Storage tab shows current mounts in read-only mode for Compose services.
Viewing Container Mounts
The Storage tab displays:
- Configured Mounts: Mounts defined in Senate (Docker services)
- Runtime Mounts: Actual mounts on running containers
For each mount:
- Type (volume, bind, file)
- Source location
- Destination path
- Read/write mode
Volume Management
Disk Usage
View volume disk usage in the Storage tab. Shows:
- Total size
- Used space
- Available space
Volume Location
Volumes are stored on the host at:
/var/lib/docker/volumes/{volume-name}/_dataBest Practices
Database Storage
Always use volumes for databases:
# PostgreSQL
Source: postgres-data
Destination: /var/lib/postgresql/data
# MySQL
Source: mysql-data
Destination: /var/lib/mysql
# MongoDB
Source: mongo-data
Destination: /data/dbFile Uploads
For user-uploaded files:
Source: uploads
Destination: /app/uploadsBackups
Implement a backup strategy:
- Use volume snapshots (if supported by host)
- Run backup containers with volume access
- Copy to external storage (S3, etc.)
Read-Only Mounts
Use read-only mounts for:
- Configuration files
- Static assets
- Shared libraries
Source: config-files
Destination: /app/config
Read Only: trueRelated
- PostgreSQL Cookbook - Database setup
- Redis Cookbook - Cache storage
- Services - Service configuration