Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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

Back up Docker in separate layers: archive every named or anonymous volume that holds application data, save any locally built or cached images, and preserve the Compose file or original docker run options. A container backup alone is not enough: docker export and docker container commit exclude data stored in mounted volumes. During recovery, load the images, recreate the containers with their original configuration, create fresh destination volumes, and extract each volume archive into the matching mount.

What a complete Docker backup contains

A Docker service is assembled from several independent pieces. The container is a runtime instance with a writable filesystem; the image supplies its base filesystem and application code; volumes and bind mounts hold data outside the container lifecycle; and Compose or docker run options describe how everything is connected. A reliable backup preserves the pieces separately so they can be restored in the right order.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Backup artifact What it captures What it does not capture Primary use
Volume tar archive Files in a named or anonymous Docker volume Container configuration, image layers and networks Databases, uploads and other persistent application data
docker image save archive Selected image layers, parent layers and tags Runtime data in volumes and container settings Offline image preservation or migration to another host
Compose file or equivalent run options Service definitions, mounts, ports, environment, networks and other creation settings The data and image bytes referenced by those settings Repeatable container recreation
docker export The container’s writable filesystem Mounted-volume contents and runtime configuration One-off capture of filesystem state
docker container commit Container filesystem changes and selected configuration Changes in attached volumes Emergency snapshot of mutable container state
Docker Desktop VM backup Platform-specific Desktop VM disk or image data Portability across Desktop backends and operating systems Full Desktop reinstall or VM recovery

Think of the volume archive as the authoritative copy of application data. Docker manages volumes separately from the container that uses them, so deleting a container does not automatically remove a volume. That separation is useful for upgrades and migrations, but it also means a container-only backup can appear successful while omitting the files you actually need.

Inventory the deployment before touching it

Start by recording enough information to rebuild the deployment without relying on memory. For each service, capture the container name, exact image name and tag, environment variables, published ports, attached networks, volume and bind-mount declarations, secrets-handling requirements, restart settings and the Compose file if one exists.

#1 Best Overall
SSK Portable SSD 1TB External Solid State Hard Drive USB C Up to 1050MB/s
  • Capacity Display Variance: 1TB external ssd often appears as around 931GB on Windows. MacOS can show full 1 TB 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
  • Container identity: record names and the image reference, including the tag rather than only a mutable name such as latest.
  • Runtime options: write down port mappings, network attachments, privileged or capability settings, restart policy, user and working-directory settings, health checks and entrypoint overrides when used.
  • Storage: distinguish named volumes, anonymous volumes and host bind mounts. A bind mount’s source directory is already on the host and must be backed up as host data; the volume tar procedure below is for Docker-managed volumes.
  • Configuration files: retain the Compose YAML, an environment file where appropriate, and any scripts used to create the services.
  • Secrets: identify credentials and certificates separately. Do not casually place passwords in committed images or unprotected configuration archives.

If the deployment was created with Compose, keep that file with the backup set. If it was created with individual commands, preserve the complete docker run options. Docker Desktop’s recovery guidance makes the same distinction: when data is in volumes or bind mounts, backing up the containers themselves may not be necessary, provided the creation options are retained so the containers can be recreated.

Quiesce stateful applications before archiving

A tar archive copies files; it does not coordinate transactions inside a database or other stateful application. For application-level consistency, stop the service or pause its writers before copying its volume. Use the application’s documented backup or flush procedure when one is required, then archive the quiescent volume. Stateless caches can often be treated differently, but database files, queues and indexes should be considered inconsistent if they are changed during the copy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Notify users or stop traffic to the service.
  2. Use the database or application procedure to flush and close active writes.
  3. Stop or pause the relevant container while the archive is created.
  4. Record the application version and any recovery steps alongside the archive.

The Docker commands provide the archive mechanics; deciding what constitutes a consistent application snapshot remains the responsibility of the database or application owner.

Back up a Docker volume with a temporary container

Docker’s documented pattern uses a helper container that mounts the source volume, plus a host directory mounted at /backup. The helper runs tar and exits, leaving the archive on the host.

1. Create a helper container for the source volume

docker run -v /dbdata --name dbstore ubuntu /bin/bash

This creates or opens a volume mounted at /dbdata inside a stopped helper container named dbstore. If the volume already exists, use the same volume declaration that the application uses. The helper is only a mount holder; it is not a replacement for the application container.

2. Write the tar archive to the host

docker run --rm --volumes-from dbstore -v $(pwd):/backup ubuntu 
  tar cvf /backup/backup.tar /dbdata

--volumes-from dbstore gives the temporary container the same volume mount. -v $(pwd):/backup exposes the current host directory, so the resulting backup.tar remains after the helper exits. When the command completes and the container stops, the archive contains the dbdata volume contents.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
SSK Portable SSD 250GB External Solid State Hard Drive USB C Up to 1050MB/s
  • Capacity Display Variance: 250GB external ssd often appears as around 232GB on Windows. MacOS can show full 250 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

Repeat the procedure for every volume that contains data. Use unambiguous archive names such as postgres-data.tar, uploads.tar and queue-data.tar, and keep a small manifest mapping each archive to its source volume and destination mount. If you compress an archive, document that it must be decompressed or streamed through the matching extraction command during restore.

3. Verify the archive before deleting anything

  • Confirm the tar file exists on the host and has a plausible size.
  • List its contents without extracting them: tar tvf backup.tar.
  • Check that expected top-level directories and representative files are present.
  • Record the archive’s checksum in an integrity manifest and store that manifest with the backup set.

Do not remove the original volume merely because the tar command succeeded. Keep the source until a separate restore test has proved that the archive can be extracted and the application can read the recovered data.

Restore a volume into a new container or destination volume

Restore into a newly created destination rather than extracting over a live production volume. This keeps the original data available if the archive, path or application version is wrong.

1. Create a destination mount holder

docker run -v /dbdata --name dbstore2 ubuntu /bin/bash

Here dbstore2 owns the new destination volume mounted at /dbdata. If you need a specific named volume, declare that name in the -v option or create it first with docker volume create, then mount it at the path expected by the application.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Extract the archive into the destination

docker run --rm --volumes-from dbstore2 -v $(pwd):/backup ubuntu 
  bash -c "cd /dbdata && tar xvf /backup/backup.tar --strip 1"

The archive created by the backup command contains a leading dbdata directory. Running tar from /dbdata with --strip 1 removes that leading directory so the files land directly in the destination volume. Inspect the archive first if your own tar command used a different path layout; stripping the wrong number of components can place files one directory too deep.

3. Recreate the application and validate it

  1. Load the required images if they are not already present.
  2. Recreate the service with the preserved Compose file or original run options, pointing it at the restored volume.
  3. Start the service and watch its logs for migration, permission, schema or version errors.
  4. Perform an application-level check: log in, open representative records, read uploaded files and verify any required background workers.
  5. Only after validation should you switch traffic from the old instance or delete the original volume.

Docker documents this volume technique as suitable for automated restores and restore testing. A drill on a fresh volume is the practical way to discover missing configuration, an incomplete archive or an incompatible application version before an incident.

Rank #3
SSK Portable SSD 500GB External Solid State Hard Drive USB C Up to 1050MB/s
  • 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

Preserve and restore images

A volume archive contains data, not the image that runs the service. Save locally built, privately tagged or otherwise cached images when the destination cannot pull them from a registry or when you need to reproduce the exact local image set.

Save several images in one archive

docker image save -o images.tar image1 image2

docker image save includes the selected images’ parent layers and tags. Include every image required by the Compose project, using the exact references recorded during inventory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Optionally compress a single image stream

docker image save myimage:latest | gzip > myimage_latest.tar.gz

Compression reduces storage space but adds a decompression step during recovery. Keep the tag and source image reference in the manifest so an archive named only by a short filename is not ambiguous.

Load images on the destination host

docker image load -i images.tar

After loading, check that the expected tags are available before starting the recreated containers. Image archives do not contain runtime volume data, environment values supplied at launch, network attachments or port publishing.

Why docker export is not a volume backup

docker export archives a container’s filesystem, which is useful for a one-off capture of files written into the container’s writable layer. It does not export the contents of volumes associated with that container. The command exports the underlying directory beneath a mounted volume rather than the volume’s data itself. Consequently, a successful export can omit a database, media library or uploaded files that were stored on a mount.

Use the volume tar procedure for persistent data. Use docker export only when the writable container filesystem itself is the object you intend to preserve, and retain the separate configuration needed to run an imported filesystem.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Crucial X9 2TB Portable SSD, Up to 1050MB/s, USB 3.2 USB-C, External Solid State Drive, Compatible with Windows, Mac, & Android, Reliable Storage for Games, Files, & Backups, Black - CT2000X9SSD902
  • High-speed Performance: Designed for casual gamers and everyday use, this external SSD with up to 1050MB/s accelerates large file transfers, media editing, and backup processes outperforming traditional hard drives
  • Built to Last: Perfect for travel and all types of weather with IP55 water and dust resistance. Plus, it's drop resistant up to 7.5 ft (2 meters). This portable drive is designed for durability and reliability wherever you go
  • Broad Compatibility: External drive connects effortlessly with Windows, Mac, iPad Pro, Chromebooks, Android, Linux, PS4, PS5, and Xbox via USB-C and USB-A for easy and fast file transfers
  • High-Capacity Storage: Store all your photos, videos, backups, and more with this compact 2TB SSD. It's perfect for students, everyday users, and anyone needing secure and reliable storage for their files
  • Bonus Software Included: Enjoy three months of Mylio Photos plus and Acronis True Image when you purchase and register your external drive

What docker container commit captures—and its risks

docker container commit creates a new image from changes in a container’s filesystem and can preserve selected configuration. It does not include changes made in attached volumes, so it cannot replace a volume backup. It also captures the state of a mutable container rather than documenting a repeatable service definition; the Compose file or original run options remain necessary for predictable recreation.

Treat committed images as sensitive. Environment variables can contain passwords, proxy credentials or other secrets, and those values may be exposed through image metadata or later inspection. Remove sensitive material before committing when possible, and control access to any image archive created from a committed container.

Rebuild a service from Compose or equivalent configuration

Once images and volumes are available, recreate the containers from declared configuration instead of trying to preserve a running container as a single opaque object. A Compose file records service relationships, mounts, networks, ports and options in a form that can be reviewed and rerun. For a command-created deployment, execute the original docker run options again, updating only the destination volume names or host paths required by the recovery plan.

  • Restore network names and aliases before starting dependent services.
  • Reapply environment values and secret references from the secured configuration source.
  • Attach each restored volume to the same path expected by the image.
  • Recreate bind mounts from the backed-up host directories.
  • Preserve startup order or health checks where one service depends on another.

Do not assume that loading an image or creating a volume starts anything. Images, data and runtime configuration are separate recovery steps.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Moving Docker volumes to another server

  1. On the source host, quiesce the application and create one tar archive per persistent volume.
  2. Save any locally required images with docker image save.
  3. Copy the volume archives, image archives, Compose/configuration files and integrity manifest to storage separate from the source host, then transfer them to the destination.
  4. Load the image archive on the destination with docker image load.
  5. Create fresh destination volumes and extract each archive with the helper-container method.
  6. Deploy the Compose project or repeat the original run options, changing only host-specific paths and names.
  7. Validate application data and connectivity before directing users to the new host.

The archive is portable at the file-data level, but the destination still needs a compatible Docker environment, image architecture and application configuration. Keep the source host intact until the migration has passed its validation checklist.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Recovering after reinstalling Docker Desktop

For a reinstall, the most portable plan is to restore from volumes, images and configuration rather than depending on an internal Desktop VM layout. Copy the backup set to a safe location separate from the computer being reinstalled. An external USB SSD or hard drive can serve as that task-enabling storage, provided it has enough capacity and is readable by the operating system used for recovery.

Best Value
OSCOO 2TB External Hard Drive, Up to 2100MB/s, USB 3.2 Gen 2 External SSD
  • Built for Creators: Capture, edit, and transfer with ease. NVMe SSD with premium NAND Flash delivers up to 2100MB/s—perfect for 5K video, RAW photos, and gaming assets
  • Record Without Limits: Direct 4K 120fps HDR recording from compatible USB-C iOS/Android phones, cameras, and tablets with supported pro apps. Ideal for high-bitrate shooting on the go
  • Rugged, Reliable, Ready: Durable aluminum shell with water- and drop-proof protection. SMART monitoring and advanced error correction keep your data safe in any environment
  • Works Where You Do: True plug-and-play with laptops, desktops, cameras, projectors, and more. Fully compatible with Windows, Mac, iPad Pro, Chromebooks, Android, Linux, PS4, PS5, and Xbox devices
  • Pocket-Sized Power & Capacity Notice: Ultra-slim 2.85 × 1.52 × 0.40 in, 0.03 lb SSD fits any pocket or gear bag. Actual usable storage may be ~7–10% less than labeled due to system calculation differences. Supports up to 2100MB/s under ideal USB 3.2 Gen 2x2/Thunderbolt 4/5 conditions; older interfaces may reduce speeds
  1. Reinstall Docker Desktop and confirm that the engine is running.
  2. Copy the archives and Compose/configuration files onto the new host.
  3. Load saved images.
  4. Create fresh volumes and extract the corresponding tar archives.
  5. Recreate services from Compose or the preserved run commands.
  6. Check logs, application data, ports and dependent services.

Docker Desktop VM backup is another option for platform-specific recovery of Desktop’s VM disk or image data. Its paths and behavior depend on the operating system and backend, making it less portable than independent volume and image archives. Use a VM backup when you specifically need full Desktop-state recovery, not as a substitute for understanding which volumes and configuration your application requires.

Storage, integrity and restore testing

Keep backup artifacts away from the Docker host so a disk failure, accidental deletion or host compromise does not destroy both production and recovery copies. The backup set should contain:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • One clearly named tar archive for each persistent volume.
  • Image archives and their image/tag manifest.
  • The Compose file, environment-template information and service creation options.
  • A record of Docker, image and application versions used during the backup.
  • Checksums or other integrity metadata for every archive.
  • Restore notes describing the extraction path and validation checks.

Run a recovery drill on a fresh volume and container. Load the images, recreate the services, extract each archive and verify application-level data rather than stopping at a successful tar exit code. Record what worked, what required manual intervention and how long the recovery took; update the Compose file or runbook when the drill exposes undocumented settings.

Common failure modes and fixes

The restored service starts with an empty database

The archive may have been made from the wrong volume, extracted to the wrong mount path, or created while the application used a bind mount instead of a Docker volume. Recheck the inventory, inspect the tar listing, and confirm that the recreated container mounts the restored volume at the path the image expects.

The archive exists but expected files are missing

docker export or docker commit may have been used instead of a volume archive. Repeat the backup through a helper container with --volumes-from, and verify the archive contents before retiring the source volume.

Files appear one directory too deep

The extraction path and archive prefix do not match. Inspect tar tvf output, then adjust the working directory or --strip 1 setting. Do not blindly extract over the production volume.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Containers cannot be recreated after reinstall

An image archive alone does not preserve ports, networks, environment values or mounts. Restore the Compose file or the complete docker run options, then recreate those settings explicitly.

The restored database reports corruption

The source was likely archived while writes were active, or the application requires a logical backup procedure. Repeat the operation with writers stopped or paused and follow the database vendor’s consistency procedure before archiving.

A committed image exposes credentials

Inspect the image and its metadata, restrict access to the archive, rotate exposed credentials and replace the emergency snapshot with a clean image build. Never treat docker container commit as a secret-management mechanism.

A practical recovery checklist

  • Inventory containers, images, tags, mounts, networks, ports, environment and secrets.
  • Identify every named, anonymous and bind-mounted data location.
  • Quiesce databases and other stateful writers.
  • Create and inspect one tar archive per Docker volume.
  • Save locally required images, including tags.
  • Preserve Compose or complete container-creation options.
  • Copy archives and integrity metadata to separate storage.
  • Test extraction into fresh volumes on a non-production deployment.
  • Validate records, files, service dependencies and user-facing behavior.
  • Keep the original host and volumes until recovery is accepted.

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.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.