Back up a Docker volume by mounting it in a temporary helper container and archiving its files to a host directory outside the volume. To restore, extract that archive into the intended destination volume, then start the application with that volume mounted at the correct path and verify the data from inside the application. For a live database, a raw file archive is not automatically transactionally consistent: use the database’s own backup process or cleanly stop writes before copying.
What a Docker volume backup includes—and what it does not
A Docker volume is a persistent data store managed by Docker. Its contents are separate from a container’s writable layer, so removing a container does not by itself remove a named volume. That separation is useful when replacing or recreating a container, but it also means a container or image backup is not necessarily a data backup. Docker’s volume guide documents a helper-container workflow for copying volume files into an archive and restoring them later.
As an Amazon Associate I earn from qualifying purchases.
A volume archive covers the files in the selected volume. It does not, by itself, preserve the full deployment: you may also need the image version, environment variables, Compose configuration, secrets, network settings, and other volumes. Keep those configuration details alongside the backup plan, while storing the archive somewhere independent of the volume it protects.
Free tools Windows power users keep installed
One-click scans. No signup required.
- Volume archive: copies files from one selected volume to a host-mounted destination.
- Database-native backup: uses the database’s own backup mechanism and is the safer choice for important database data, especially when the service is active.
- Docker Desktop VM backup: covers a broader Desktop data scope and is different from backing up one volume. Docker says Desktop must be fully stopped before directly backing up VM disk files; storage locations vary by platform and backend. Follow the platform-specific Docker Desktop instructions rather than copying a path from another machine.
These methods solve different recovery problems. A tar archive is portable as a collection of files, but it does not capture a running database’s transaction state or all Docker configuration. A whole-Desktop disk backup has broader scope but is tied to Desktop’s platform and storage arrangement.
#1 Best Overall
- Get NVMe solid state performance with up to 1050MB/s read and 1000MB/s write speeds in a portable, high-capacity drive(1) (Based on internal testing; performance may be lower depending on host device & other factors. 1MB=1,000,000 bytes.)
- Up to 3-meter drop protection and IP65 water and dust resistance mean this tough drive can take a beating(3) (Previously rated for 2-meter drop protection and IP55 rating. Now qualified for the higher, stated specs.)
- Use the handy carabiner loop to secure it to your belt loop or backpack for extra peace of mind.
- Help keep private content private with the included password protection featuring 256‐bit AES hardware encryption.(3)
- Easily manage files and automatically free up space with the SanDisk Memory Zone app.(5). Non-Operating Temperature -20°C to 85°C
Identify the correct volume before copying anything
The most consequential backup mistake is archiving a different volume from the one the service actually uses. In Compose, a top-level volume key is a declaration, not always the final Docker volume name: project scoping can affect the name. Compose creates a declared volume when one does not exist and reuses an existing one when it does, so a typo or removed volume can result in a fresh, empty store. See Docker’s Compose volume reference.
- List available volumes: run
docker volume lsand identify likely candidates. - Inspect the running application container: run
docker inspect app_containerand examine itsMountssection. Match the volume’s source name to the container destination path. Substitute the actual container name or ID forapp_container. - Check the volume itself: run
docker volume inspect actual_volume_name. Confirm the name and driver before using it in a backup or restore command. Docker documents volume creation and driver options in its volume create reference. - Record the service’s data path: note the in-container destination, such as the database’s configured data directory. Do not assume that another image or database uses the same path.
- Record the deployment details: keep the Compose file or equivalent run configuration, image and version, volume name, mount destination, and any necessary application configuration with your recovery notes.
For Compose, compare the service’s volume mount with the top-level declaration, then verify the actual Docker volume attached to the running container. Docker’s database guide, for example, shows MySQL using /var/lib/mysql and retaining its data across container removal and recreation when the replacement uses the same named volume. That path is specific to the example; use the real application data path for your service. See Docker’s containerized databases guide.
Make a file-level archive of a named volume
The following commands create an archive from a named volume called my_volume and write it into the current host directory. They use the modern --mount form: one mount attaches the volume to the helper container at /data, and the other exposes the current host directory at /backup. The archive is made from /data but written to /backup, so it is not stored inside the source volume.
docker volume inspect my_volume
mkdir -p backups
docker run --rm
--mount type=volume,source=my_volume,target=/data,readonly
--mount type=bind,source="$(pwd)/backups",target=/backup
ubuntu
tar -C /data -cpf /backup/my_volume.tar .
Run this from a POSIX-style shell in an environment where Docker can access the host directory. The first command is a deliberate identity check, not a backup; confirm it reports the volume you intend to protect. The helper image must be available locally or pullable, and it must contain tar. The read-only volume mount helps prevent the helper from changing source files. The archive will be at backups/my_volume.tar relative to the directory from which you ran the command.
Rank #2
- MADE FOR THE MAKERS: Create; Explore; Store; The T7 Portable SSD delivers fast speeds and durable features to back up any endeavor; Build your video editing empire, file your photographs or back up your blogs all in an instant
- SHARE IDEAS IN A FLASH: Don’t waste a second waiting and spend more time doing; The T7 is embedded with PCIe NVMe technology that brings fast read and write speeds up to 1,050/1,000 MB/s¹, making it almost twice as fast as the T5
- ALWAYS MAKE THE SAVE: Compact design with massive capacity; With capacities up to 4TB, save exactly what you need to your drive – from large working files to game data and everything in between
- ADAPTS TO EVERY NEED: Whether using a PC or mobile phone, count on the T7 for extensive compatibility²; It’s a true team player when it comes to heavy-duty application usage or file-saving
- HI RESOLUTION VIDEO RECORDING: Record Ultra High Resolution (4K 60fs) videos directly onto the T7 Portable SSD with your favorite camera or mobile devices; Supports iPhone 15 Pro Res 4K at 60fps video and more³
This example archives the contents of /data using . as the archive path, so the archive’s top level is the volume’s files and directories. That makes the matching restore command straightforward. If the volume contains application data that changes during the copy, however, read-only mounting does not make the copy a consistent database snapshot. Coordinate with the application as described in the database section below.
Docker’s official guide also shows the underlying helper-container pattern using a data container named dbstore, a volume at /dbdata, a host-mounted /backup directory, and tar:
docker run -v /dbdata --name dbstore ubuntu /bin/bash
docker run --rm --volumes-from dbstore -v "$(pwd)":/backup ubuntu
tar cvf /backup/backup.tar /dbdata
In this documented example, dbstore is a container through which the helper accesses the volume. Adapt the image, volume attachment, host path, and shell syntax to your environment, while preserving the essential arrangement: the correct source volume is mounted, the archive destination is outside it, and the archive contains the volume’s files. The example’s archive paths begin with /dbdata; that detail matters when using its matching restore command.
Restore into a fresh or deliberately selected volume
A safe restore leaves the source volume and backup untouched until the recovered service has been checked. Restore into a new destination when possible, or use an existing volume only when you deliberately intend to replace or merge its contents. Extracting over a non-empty volume can leave old files that were not present in the archive, so it is not the same as making an exact replacement.
Rank #3
- Solid state performance with up to 800MB/s read speeds in a portable drive. (Based on internal testing; performance may be lower depending on host device, interface, usage conditions and other factors. 1MB=1,000,000 bytes.)
- Back up your content and memories on a storage solution that fits seamlessly into your mobile lifestyle.
- Take it with you on your adventures—up to two-meter drop protection means this durable drive can take a beating. (Based on internal testing.)
- Secure it to your belt loop or backpack for extra peace of mind thanks to the tough rubber hook.
- From Sandisk, a brand professional photographers trust to take on assignments.
For the archive created above, the following commands create a distinct destination volume and extract the files into it:
docker volume create my_volume_restore
docker run --rm
--mount type=volume,source=my_volume_restore,target=/data
--mount type=bind,source="$(pwd)/backups",target=/backup,readonly
ubuntu
tar -C /data -xpf /backup/my_volume.tar
Because this archive was created with tar -C /data ... ., its paths are relative to the volume contents; this restore does not use --strip. First verify that my_volume_restore is the destination you want and that the backup file exists in the mounted host directory. A named-volume mount can create a missing volume, so a misspelled destination can silently direct you to an unintended, newly created store. Confirm the result with docker volume inspect my_volume_restore.
Docker’s published restore example pairs with its earlier /dbdata archive and uses --strip 1:
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →docker run -v /dbdata --name dbstore2 ubuntu /bin/bash
docker run --rm --volumes-from dbstore2 -v "$(pwd)":/backup ubuntu
bash -c "cd /dbdata && tar xvf /backup/backup.tar --strip 1"
That strip count is appropriate to the example’s archive layout, where paths begin with /dbdata. Do not copy it blindly into another restore command. If the archive has a different leading directory—or no leading directory—the wrong strip count can remove part of a real path or place files at an unintended level. Before extracting an archive made by a different command, inspect its file listing and match the extraction directory and path handling to the archive layout.
Rank #4
- NONSTOP SPEED: Race through projects with our fastest SSD for creators; Load, edit and transfer with sustained read and write speeds of up to 2,000MB/s1; The T9 Portable SSD performs at high speeds even during longer processes
- DYNAMIC THERMAL GUARD: When you’re elbow-deep in a passion project, the T9 Portable SSD stays cool; Its advanced thermal solution withstands and controls heat to keep the SSD at ideal temperatures—even in heavy use2
- ADAPTS TO EVERY NEED: Whether you’re using a desktop, camera or a gaming console3, count on the T9 Portable SSD for extensive compatibility; It’s a true team player when it comes to heavy-duty application usage or file-saving
- STRONG. SOLID. STABLE: From concept to completion – the T9 Portable SSD gives you the longevity to last through heavy use with one convenient drive that dares to go the distance
- WORKS LIKE MAGIC: Your T9 Portable SSD performs like new with the always up-to-date Magician Software; With firmware updates, extra encryption and continual monitoring of your drive health, it works like a charm
- Choose the target: verify the destination volume name and the application’s in-container mount path.
- Extract the data: use the command appropriate to the archive layout, keeping the original archive separate and unchanged.
- Attach the target: configure the service to mount the restored volume at the same data path expected by the application.
- Start and check the service: review application logs, then perform an application-level read or integrity check appropriate to that software.
- Keep the original until recovery is proven: only retire or overwrite the original after the restored application has been validated.
Database volumes need a consistency plan
A tar copy copies files; Docker’s volume instructions do not claim that the result is transactionally consistent while a database is writing. A database may be changing multiple related files as the helper reads them. The resulting archive can therefore be unsuitable for recovery even if tar completed without an error.
For valuable database data, use the database’s native backup procedure, following that database’s documentation for the version and deployment you run. The specific command, consistency guarantees, and restore steps differ by database, and Docker’s volume-copy example does not establish them. Alternatively, stop the service or quiesce writes cleanly using the database’s documented process before making a file-level copy. A container being stopped is not a substitute for following application-specific shutdown guidance where that guidance requires more.
Plan recovery as part of the backup, not as an assumption that an archive is usable. Restore to an isolated or fresh destination, start the intended database version with its expected configuration, and verify that the application can read the data. Docker recommends automating restore testing with preferred tools in its volume documentation. Its database guide illustrates volume persistence across MySQL container replacement, but persistence alone is neither a backup nor a database-consistency guarantee.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Choose a recovery scope that matches the failure
| Method | What it is for | Consistency and portability | Main risk to manage |
|---|---|---|---|
| Helper-container tar archive | Copying one selected volume’s files to a host-mounted directory | Portable as files, but a live file copy is not established as transactionally consistent for a database | Wrong volume, archive path layout, or restoring into the wrong destination |
| Database-native backup or cleanly quiesced copy | Recovering database data with the application’s own procedures | Use the database documentation to determine guarantees and supported restore paths | Using a procedure or version mismatch, or failing to test the restore |
| Docker Desktop VM-disk backup | Recovering a broader Docker Desktop data scope | Desktop- and platform-specific rather than a portable single-volume archive | Backing up while Desktop is running or using a location from a different platform/backend |
The table distinguishes scope rather than ranking one universal winner. For a single non-database volume, a helper-container archive may fit the task. For a database, prefer its supported backup process or a carefully coordinated file copy. For Desktop-wide recovery, use Desktop’s own current instructions and account for its platform-specific storage. The cited Docker documentation does not establish a universal backup schedule, retention period, encryption method, or checksum policy; choose those based on the sensitivity and recovery needs of your deployment.
Best Value
- Capacity Display Variance: 500GB external ssd often appears as around 465GB on Windows. MacOS can show full 500 GB capacity. This is binary calculation difference and doesn’t affect SSD hard drive actual physical storage
- 1050 MB/s Speed: Instantly access to your files with blazing-fast 10Gbps external SSD read up to 1050MB/s and write up to 1000MB/s. LED Light indicates USB SSD instant activity
- Data Security: Solid state drives S.M.A.R.T. health diagnostics and adaptive TRIM optimizing data block management ensures consistent write speeds and extends the longevity of the portable SSD
- USB-C & USB-A Cable: Both cables featuring rapid USB 3.2 Gen2, this USB SSD effortlessly bridges devices, enabling seamless cross-platform file transfers and backup between computers, smartphones, tablets and iPhone
- Always Fast: No slowdowns for large file transfers. With SLC caching (25% of current available capacity allocated as high-speed cache), this external SSD delivers steady 10Gbps for transfers within the cache capacity
Backups that look plausible but omit volume data
docker commitis not a volume backup. It captures a container image from a container’s filesystem changes, not changes held in attached volumes. Docker Desktop’s backup and restore guide directs volume data users to volume-specific backup instructions.docker exportis not a volume backup. It exports a container filesystem, not mounted-volume contents. When a volume overlays a path, the export contains the underlying directory rather than the data in the mounted volume. See the container export reference.docker image savesaves images, not volume files. It may be useful to preserve an image for a deployment, but it does not replace the separate volume archive or database backup.- A Desktop VM disk copy has a different scope. It is not interchangeable with an archive of one named volume. Docker’s Desktop backup instructions specify that Desktop must be fully stopped before directly backing up VM disk files, with locations varying by platform and backend.
If you need to rebuild a deployment, think in separate recovery pieces: image or image reference, configuration, and persistent data. Confirm each is available rather than treating one container-oriented command as a complete backup.
Protect the archive and prove the restore works
The host-mounted directory is only the archive destination; it is not automatically a safe long-term backup location. Keep a copy independent of the source volume and the Docker host when your recovery requirements call for it. A removable external drive is one possible destination, but it is optional: Docker’s example works with a host directory, and no particular storage device is required. Protect sensitive archives with access controls and appropriate storage security for your environment.
- Keep the volume name, container mount path, Compose configuration, application version, and any database-specific restore notes with the recovery record.
- Check that the archive file exists and has a plausible size after the command completes. A file’s presence alone does not establish that the application can recover from it.
- Retain the original source data until a test restore has started successfully and passed an application-level check.
- Use a clean destination for a test when feasible, so leftover files do not mask a missing-file or path-layout problem.
- Have a repeatable restore procedure. Docker documents automating restore tests with preferred tools, but does not prescribe a schedule or retention period.
These checks address distinct failure modes: an archive can be saved to the wrong place, contain the wrong volume, have paths extracted at the wrong level, or contain files the application cannot use. Only a restore and application-level verification tests the complete path from backup artifact to usable data.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




