Where Does Docker Data Actually Live? Backing Up by Layer
Containers are easy to rebuild — provided you know where the data lives. Three classes need different handling.
Separate the three data classes
- Named volumes: database files under docker volumes; back up /var/lib/docker/volumes with restic;
- Bind mounts: host directories mapped in compose — just include them in file backups;
- In-app exports: for MariaDB/PostgreSQL, dump first; copying live data files can yield inconsistent snapshots.
Write one compose-level script: stop → dump → restic → start. The whole cycle takes under two minutes.
Related products: NAS-RK3588 storage board, RK3588 Mini PC. Datasheets, firmware and SDKs are free at the Hugsun Documentation Center; for selection advice or volume pricing, talk to us.


