Skip to main content

Overview

Persistent storage is critical for stateful applications and databases. Dokploy uses Docker volumes to provide reliable, performant storage that persists across container restarts and redeployments.

Data Persistence

Data survives container restarts and updates

Performance

Native filesystem performance

Portability

Easy backup, restore, and migration

Volume Types

Creating and Managing Volumes

Via Docker Compose

docker-compose.yml

Via Docker CLI

Via Dokploy API

Create Mount

Volume Configuration Options

Volume Labels

Organize volumes with labels:

Volume Driver Options

Customize volume behavior:

Read-Only Volumes

Mount volumes as read-only:

Database Storage

Each database type has specific volume requirements:

PostgreSQL

MySQL/MariaDB

MongoDB

Redis

Volume Backup and Restore

Backup a Volume

Manual Backup

Restore a Volume

Manual Restore

Automated Backups via Dokploy

Configure automated volume backups:

Volume Migration

Between Servers

1

Backup on Source Server

2

Transfer to Target Server

3

Create Volume on Target

4

Restore on Target Server

Between Volume Drivers

Migrate from local to NFS:

Storage Drivers

Docker supports multiple storage drivers:
Modern, performant storage driver:
  • Best performance
  • Production-ready
  • Supports Linux 4.0+
  • Copy-on-write
Recommended for most use cases.

Check Current Driver

Performance Optimization

Named volumes are faster and more portable:
Improve bind mount performance:
Store temporary data in memory:
PostgreSQL example:

Storage Monitoring

Check Volume Sizes

Monitor Disk Usage

Cleanup Unused Volumes

docker system prune removes ALL unused data including volumes. Use with caution!

Multi-Node Storage

For multi-node deployments, use shared storage:

NFS Configuration

Volume Placement

Pin volumes to specific nodes:

Best Practices

Use Named Volumes

Prefer named volumes over bind mounts for portability

Backup Regularly

Automate volume backups to external storage

Monitor Disk Space

Set up alerts for disk usage thresholds

Document Mount Points

Maintain documentation of all volume mounts

Troubleshooting

Fix ownership issues:
  • Check disk usage: df -h
  • Remove unused volumes: docker volume prune
  • Increase disk space
  • Configure volume size limits
  • Verify volume is defined in compose file
  • Check mount path is correct
  • Ensure volume isn’t being recreated on each deploy
  • Inspect volume: docker volume inspect volume_name
  • Verify NFS server is accessible
  • Check firewall rules
  • Test mount manually: mount -t nfs server:/path /mnt
  • Review NFS server exports: /etc/exports

Next Steps

Backups

Configure automated volume backups

Databases

Database-specific storage configuration

Multi-Node

Shared storage in multi-node deployments

Monitoring

Monitor storage usage and health