iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
To back up a Docker volume, mount it into a temporary helper container, mount a separate host directory for the archive, and use tar to copy the volume’s files. To restore, extract that archive into the intended destination volume, then start the application with that volume mounted at its expected path and verify the data from inside the application. For a live database, use its native backup method or cleanly pause writes first: a file archive alone does not promise a transactionally consistent backup.
What a Docker volume backup protects
A Docker volume is persistent storage managed separately from a container’s writable layer. Removing a container does not by itself remove its named volume, which lets a replacement container reuse the same data. That persistence is useful, but it is not a backup: accidental volume removal, corruption, or a bad restore can still put the data at risk. Docker explains volume persistence and its helper-container backup and restore workflow in its Volumes documentation.
A volume archive captures files from a volume. It does not automatically capture the application image, container settings, Compose configuration, secrets, or other volumes. Treat those as separate parts of a recovery plan. A reliable recovery also depends on knowing the volume’s actual Docker name, its mount path inside the application container, and any configuration required to start the service.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
The commands below use an Ubuntu helper image with tar, following Docker’s documented pattern. Adapt the image and shell syntax to your environment, while preserving the essential setup: mount the correct source volume, put the archive somewhere outside that volume, and copy the files rather than writing the backup into the volume itself.
#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
Before you back up: identify the right volume and data path
Inspect the application’s mounts
Do not assume a volume has the same name as its service or Compose key. Inspect the application container’s mounts and note both the Docker volume name and the destination path inside the container. For example, a database might store its files at /var/lib/mysql, but use the path configured for your own application. Docker’s database guide uses that MySQL path as an example, not as a universal database location: Use containerized databases.
You can inspect a container’s mounts with:
docker inspect CONTAINER_NAME
Find the mount whose destination is the application’s data directory. Record its source volume name and destination path. If using Compose, check the service’s volume mount and the top-level volumes declaration as well. Compose may use a project-scoped actual volume name rather than the key you wrote in the file.
Decide whether a file copy is safe while the service runs
For ordinary files, the helper-container method copies the volume’s filesystem contents. For a database actively accepting writes, copying those files while they change may capture an inconsistent state. Docker’s volume instructions describe file copying; they do not claim it creates a transactionally consistent database snapshot. Use the database’s own backup procedure, or stop/quiesce writes using that database’s documented method before copying its files. In either case, test a restore rather than assuming the archive is usable.
Choose an independent archive location
The host directory mounted at /backup in the examples is the current working directory. Choose a location with enough free space and access controls appropriate for the data. The archive must be outside the source volume; otherwise, the backup may be included in the copy or disappear with the volume. Keep a copy independent of the Docker host when recovery from host loss matters. An external drive is one possible destination, not a requirement.
Create a tar archive of a volume
Docker’s documented helper-container pattern
Docker’s example first creates a container called dbstore with a volume mounted at /dbdata, then uses that container to expose the volume to a temporary helper. The archive is written into the host directory mounted at /backup:
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
This produces backup.tar in the current host directory. In an existing deployment, do not create a new example volume and assume it contains your application data. First identify the real source volume. You can mount a volume directly into a helper container or use --volumes-from with a container that already has the intended volume attached. If using --volumes-from, check which volumes are attached to that container; it can expose more than the one you mean to archive.
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³
Directly mount a named volume when you know its name
For a known named volume, a direct mount makes the source explicit. For example, if the source volume is named app_data:
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →docker run --rm
-v app_data:/source:ro
-v "$(pwd)":/backup
ubuntu tar -C /source -cvf /backup/app_data.tar .
The source is mounted read-only for the helper, and the archive contains paths relative to the volume root. Change app_data only after verifying the actual volume name. A misspelled name can refer to a different or newly created empty volume, so do not treat a successful command as proof that you backed up the intended data. Docker documents volume creation and driver options in its docker volume create reference.
Either archive layout is workable. Docker’s first example archives /dbdata as the leading directory in the archive; the direct-mount example archives the contents with relative paths. The layout determines how you extract the archive, so note which command created it.
Check the result before relying on it
Confirm the archive exists in the host directory and has a plausible size. You can list its contents without extracting it:
tar -tvf backup.tar
For the Docker example, entries are under the dbdata directory. For the direct-mount example, entries are relative to the volume root. A listing can reveal an empty archive or an unexpected top-level directory, but it does not prove that a database can use the files. Preserve the archive and the notes identifying its source volume, in-container path, application, and backup method.
Restore a volume without overwriting the original
Create and select a destination volume
When possible, restore into a fresh volume first. That leaves the original volume available if the archive is incomplete or the extraction path is wrong. Create a destination volume with an explicit name:
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.
docker volume create app_data_restore
Before extraction, make sure you have selected the intended destination and that it is empty or safe to overwrite. Do not restore over the only copy of important data. Docker’s documented restore example creates another volume-bearing container, then extracts the archive into it.
Extract a relative-path archive
If you created the archive using the direct-mount command above, restore it into the destination volume like this:
docker run --rm
-v app_data_restore:/target
-v "$(pwd)":/backup
ubuntu tar -C /target -xvf /backup/app_data.tar
Because this archive contains paths relative to the volume root, extract it at /target without stripping a path component.
Free tools Windows power users keep installed
One-click scans. No signup required.
Extract Docker’s example archive layout
Docker’s documented example restores an archive whose entries begin with /dbdata. It extracts from inside the destination directory and removes that first path component:
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"
The --strip 1 option is specific to that archive layout. If the archive has a different top-level path—or no top-level directory at all—using it can place files at the wrong level. Inspect the archive first and match the extraction directory and strip count to its paths. Docker describes this restore pattern in the Volumes guide.
Start the application and verify it
Start the service only after confirming that it will mount the destination volume at the application’s expected in-container data path. Check the application logs and perform a meaningful application-level read or integrity check. A successful extraction, or even a successful container start, is not by itself proof that the application can read all required data.
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
Keep the original volume until the restored application has been checked. Once the destination has been verified, update the service configuration to use it if that is your recovery plan. Preserve the volume name and mount-path information with the backup so a later restore does not depend on guesswork.
Choose the right backup method for the data
| Method | What it covers | Consistency and portability | Best fit |
|---|---|---|---|
| Helper-container tar archive | Files in the selected volume | Portable as a file archive, but a raw copy does not guarantee consistency for a live database | Volume files, or data copied after writes are safely quiesced |
| Database-native backup | Data captured through the database’s own backup mechanism | Use the database’s documented procedure; restore compatibility depends on that database and its configuration | Important database data, especially when the service cannot simply be treated as a static set of files |
| Docker Desktop VM-disk backup | A broader Docker Desktop data scope than one volume archive | Specific to Docker Desktop’s platform and backend; not as portable as an individual volume archive | Recovery of Docker Desktop data at the VM-disk level |
The Docker Desktop backup guide distinguishes image/container-related backup from volume data and describes a separate VM-disk recovery scope. It says Docker Desktop must be fully stopped before directly backing up VM disk files; default locations vary by platform and backend, so follow the current instructions for the actual installation rather than copying another system’s paths: How to back up and restore your Docker Desktop data.
For database-native procedures, follow the database’s own documentation; the Docker sources cited here do not compare particular database backup tools or prescribe a schedule, retention period, encryption method, or checksum. As operational best practice, keep secure independent copies and perform restore drills. Choose the method based on the recovery scope you need, how writes are handled, and whether you have tested that the application can use the restored data.
Back up the volume separately from images and containers
A common recovery mistake is to save a container or image and assume its mounted data is included. It is not. Docker Desktop’s backup guidance directs volume users to the volume-specific procedure. The docker container export reference also specifies that exported container filesystems exclude mounted volume contents. If a volume is mounted over a path, the container’s underlying directory is not a substitute for the data in that mounted volume.
Likewise, docker image save saves images, not the contents of a data volume. Back up what is needed for the full recovery separately: the image or build/configuration inputs, service configuration, and one backup for each required volume. A volume archive alone is not a complete application deployment.
Recommended Free Tools
Compose considerations during restore
Compose declares named stores in the top-level volumes section and services mount them at container paths. Compose creates a declared volume if it does not exist and uses the existing one otherwise. Consequently, a typo, changed project name, or removed volume can lead a service to start with a new empty volume even while the restored data sits in a differently named one. See Docker’s Compose volumes reference.
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
Before starting a Compose service after restore, verify the actual volume name and service mount destination against the restored volume. Do not rely on the Compose key alone to identify the engine-level volume. If you intend to preserve a project’s existing volume, confirm that the service will reuse it; if you intend to use a restored volume, make that selection explicit in the service configuration.
Common restore problems and how to diagnose them
The restored container starts with empty data
Check that the service mounted the restored volume, not a newly created one, and that it mounted it at the application’s real data directory. Compare the volume identity and mount destination to the notes you made before backup. Compose’s create-if-missing behavior is a frequent reason the application sees an empty store.
Files appear one directory too deep—or are missing
Inspect the archive listing and compare its top-level path with the extraction directory. Docker’s sample archive needs --strip 1 because its paths begin at /dbdata; a relative-path archive from the direct-mount example does not. Use the matching extraction command rather than adding or removing a strip option by habit.
The files are present, but the application cannot use them
Confirm the expected in-container path, then review application logs and perform an application-level check. A raw file copy of a database taken during writes may not represent a usable consistent state. Restore from a database-native backup or repeat the file-copy process after writes have been quiesced according to the database’s procedure.
The archive is missing, unexpectedly small, or includes the wrong data
Check the host directory bound to /backup, verify the source volume name, and inspect the archive contents. Be sure the archive destination was not inside the source volume. If the helper used --volumes-from, confirm that its source container had the intended mount and that you did not archive a different attached volume.
Quick Recap
A practical recovery checklist
- Identify the correct Docker volume name and the application’s in-container data path.
- For a database, use its native backup procedure or quiesce writes cleanly before copying files.
- Write the archive to storage outside the source volume and retain the service configuration needed to reconnect it.
- Inspect the archive paths so the restore command uses the correct extraction directory and strip behavior.
- Restore into a fresh or intentionally selected volume, leaving the original available until verification is complete.
- Start the service with the intended volume, check logs, and verify the data through the application.
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.

