Podman Volume Backup
`podman volume export` writes a plain tar of a volume's contents - no helper container, no `-v $(pwd):/backup` incantation. The restored copy is genuinely independent: the original gains a row and the copy does not.
Storage Guide 34 of 47 Intermediate
- OSUbuntu 26.04 LTS (resolute)
- Podman5.7.0
- Runtimecrun 1.21
- Networknetavark 1.16.1
- TimeAbout 12 min
- Reviewed22 August 2026
Written against the versions above. Podman follows the distribution here rather than a vendor repository, so the version you get is the one Ubuntu shipped. The commands are stable across 5.x.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| PODMAN01 | 192.168.0.24 | Ubuntu 26.04 LTS | Primary Container Host | 2 Core | 4 GB | 50 GB |
Before you start
- guide 60 - this backs up the kind of volume created there.
-
A volume with something in it
Two lines of text in a named volume, standing in for whatever your application keeps there.
bash Example session podman volume create dbdatadbdatapodman run --rm -v dbdata:/data docker.io/library/alpine sh -c 'echo "row one" > /data/table; echo "row two" >> /data/table; ls -l /data'total 4-rw-r--r-- 1 root root 16 Aug 22 12:11 tablepodman run --rm -v dbdata:/data docker.io/library/alpine cat /data/tablerow onerow twoExpected resultA volume containing a two-line file.
Success conditionThere is data worth backing up.
-
Export, and look at what you got
podman volume export dbdata -o ~/dbdata.tarThat is the whole backup. Worth appreciating if you have done this with Docker, where there is no equivalent and the documented approach is to run a throwaway container with both the volume and a host directory mounted, and tar inside it.
tar -tvfshows an ordinary archive with paths relative to the volume root:-rw-r--r-- 0/0 16 2026-08-22 12:11 tableNo leading directory, and ownership recorded as
0/0- the in-namespace view. Because it is a plain tar you can inspect it, extract one file from it, or store it anywhere; nothing about it is Podman-specific.Restoring needs an existing volume -
podman volume create dbrestorefirst, thenimport. It will not create the volume for you, which is a small annoyance and a deliberate guard against typos silently making new volumes.bash Example session podman volume export dbdata -o ~/dbdata.tarls -l ~/dbdata.tar-rw-r--r-- 1 sysadmin sysadmin 2048 Aug 22 12:11 /home/sysadmin/dbdata.tartar -tvf ~/dbdata.tar-rw-r--r-- 0/0 16 2026-08-22 12:11 tablepodman volume create dbrestoredbrestorepodman volume import dbrestore ~/dbdata.tarpodman run --rm -v dbrestore:/data docker.io/library/alpine cat /data/tablerow onerow twoExpected resultA 2048-byte tar containing
table, and the same two rows read back from the new volume.Success conditionThe data is in a second volume you restored from a file.
-
Prove it is a copy, not a link
Append a third row to the original, then read both:
dbdata row one / row two / row three dbrestore row one / row twoIndependent. Obvious once stated, and worth actually checking, because "restored" and "still pointing at the same data" look identical until something diverges.
What this is and is not. It is a file-level copy of a volume's contents, taken while nothing coordinates the write. For a database that is not a backup you can trust: exporting a running Postgres volume can capture a half-written page and restore to something that will not start. The engine's own dump -
pg_dump,mysqldump- is the backup;volume exportis right for uploaded files, caches, configuration and anything not being mutated under a transaction.For a database volume, stop the container first. A
podman stopbefore the export costs seconds and turns an unreliable copy into a reliable one.bash Example session podman run --rm -v dbdata:/data docker.io/library/alpine sh -c 'echo "row three" >> /data/table'podman run --rm -v dbdata:/data docker.io/library/alpine cat /data/tablerow onerow twopodman run --rm -v dbrestore:/data docker.io/library/alpine cat /data/tablerow onerow twoExpected resultThree rows in the original and two in the copy.
Success conditionYou have shown the two volumes diverge.
Troubleshooting
podman volume importfails withvolume does not exist.Why: Import does not create the volume.
Fix:
podman volume create <name>first.The restored volume has an extra directory level.
Why: The tar was made by hand from a parent directory rather than by
volume export.Fix:Archive from inside the volume root -
tar -C /path/_data -cf out.tar .- so paths are relative.A restored database will not start.
Why: The export was taken while the database was writing.
Fix:Stop the container before exporting, or use the database's own dump tool. A file-level copy of live database files is not a backup.
File ownership is wrong after a restore.
Why: Tar recorded in-namespace uids, and the restoring user may have a different subuid base.
Fix:
podman unshare chown -Rinside the volume. Same mechanics as guide 61.