Top 10 Open-Source Free Tools for Docker Volume Backup and Recovery
Think of Docker Volumes as special storage boxes that keep your important data safe and sound, even when your Docker containers take a break or need a fresh start. It's like having a secure storage unit that stays put while everything else moves around!
Why Docker Volumes are Your Best Friend:
- They're like a trusty backup drive that never forgets - your data stays safe even when containers come and go
- Your information gets its own cozy space outside the container, but it's always there when you need it
- Making backups is as easy as copying files from one folder to another
- Different containers can share the same volume - it's like a shared folder that everyone in your Docker family can access!
Here's a simple way to think about it: Imagine your Docker container is like a temporary workspace, but you want to keep some important files forever. That's where volumes come in - they're like having a permanent bookshelf in a room that occasionally gets redecorated. No matter how many times you change the room's layout, your books stay right where you put them!
With Docker Volumes, you don't have to worry about losing important information when you're updating or changing your containers. Everything stays exactly where you need it, ready to use whenever you want. It's a simple, reliable way to keep your data safe while still enjoying all the flexibility that Docker offers.
Free Docker Volume Backup and Restore Tools
In the following, we offer you the best solution that we find and tested to help you backup your docker volumes easily. However note that these tools are not to backup your databases, and for that we have another tool sets and collections for you.
1- Vackup: Backup and Restore Docker Volumes
Vackup is a free CLI tool for easily backing up and restoring Docker volumes using tarballs or container images. It allows you to export, import, save, and load Docker volumes for safe storage or migration.
It is an ideal option for moving volume data to remote storage or using image registries to share volume contents.
While it's not a replacement for database backup tools, it simplifies handling Docker volumes, especially for developers who need quick, efficient backups.
Features
- Export/Import: Backup and restore volumes using gzip'ed tarballs.
- Save/Load: Move volume data to and from container images.
- Easy CLI: Simplifies Docker volume management with easy-to-use commands.
- Remote Storage Ready: Ideal for safe backup or remote migration of Docker volumes.
- Developer-Friendly: Perfect for developers needing efficient and quick volume backup solutions.
Install Vackup
In the following command, you will see how to download the tool to your machine
sudo curl -sSL https://raw.githubusercontent.com/BretFisher/docker-vackup/main/vackup -o /usr/local/bin/vackup && sudo chmod +x /usr/local/bin/vackup
Use Vackup
1- Creates a gzip'ed tarball in current directory from a volume
vackup export VOLUME FILE
2- Extracts a gzip'ed tarball into a volume
vackup import FILE VOLUME
3- Copies the volume contents to a busybox image in the /volume-data directory
vackup save VOLUME IMAGE
2- Nautical backup
This is a super user-friendly open-source Docker-based tool that enables you to backup your Docker volumes easily.
Nautical requires almost no configuration when container volumes are all in a folder matching its container-name
within the source directory.
How to use Nautical backup with Docker and Docker Compose?
1- Docker CLI Example
docker run -d \
--name nautical-backup \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /config:/config \
-v /source:/app/source \
-v /destination:/app/destination \
-e TZ="America/Los_Angeles" \
-e CRON_SCHEDULE="0 4 * * *" \
-e SKIP_CONTAINERS="example1,example2,example3" \
minituff/nautical-backup:2.7
2- Docker Compose
services:
nautical-backup:
image: minituff/nautical-backup:2.7
container_name: nautical-backup
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /config:/config
- /source:/app/source
- /destination:/app/destination
environment: # Optional variables
- TZ=America/Los_Angeles
- CRON_SCHEDULE=0 4 * * *
- SKIP_CONTAINERS=example1,example2,example3
3- Blacklabelops Volumerize
Blacklabelops Volumerize is an open-source CLI app that enables you to backup and restore solution for Docker volume backups.
It is based on the command line tool Duplicity.
This is not a tool that can clone and backup data from running databases. You should always stop all containers running on your data before doing backups. Always make sure you're not a victim of unexpected data corruption.
Features
- Supports multiple backends as filesystems, Amazon S3, Dropbox, Google Drive, SSH/ SCP, Rsync
- Scheduled cron backups
- Start and stop containers
- Backup multiple docker volumes at once
How to use?
You can make backups of your Docker application volume just by typing:
$ docker run --rm \
--name volumerize \
-v yourvolume:/source:ro \
-v backup_volume:/backup \
-v cache_volume:/volumerize-cache \
-e "VOLUMERIZE_SOURCE=/source" \
-e "VOLUMERIZE_TARGET=file:///backup" \
blacklabelops/volumerize backup
4- Docker Volumes Backup and Share Extension
This is an amazing free Docker extension that enables developers backup their volumes easy. However, it is deprecated and removed from the Docker marketplace now. However, it is still usable.
Features
- Export a volume:
- To a compressed file in your local filesystem
- To an existing local image
- To a new local image
- To a new image in Docker Hub (or another registry)
- Import data into a new container or into an existing container:
- From a compressed file in your local filesystem
- From an existing image
- From an existing image in Docker Hub (or another registry)
- Transfer a volume via SSH to another host that runs Docker Desktop or Docker engine.
- Clone a volume
- Empty a volume
- Delete a volume
5- Docker Volume Backup S3
This is a free simple docker volume backup to S3. Withit you can create tar.gz file from docker volume and upload it to S3.
6- Docker Volume Backup
The offen/docker-volume-backup
Docker image is a lightweight (under 15MB) solution for backing up Docker volumes. It can store backups locally or to S3, WebDAV, Azure Blob Storage, Dropbox, or any SSH-compatible storage. It supports recurring or one-off backups, automatic rotation of old backups, GPG encryption, and notifications for failed backup runs.
Features
- Supports Multiple Storage Backends: Backup to S3, WebDAV, Azure Blob, Dropbox, or SSH-compatible storage.
- Backup Rotation: Automatically deletes old backups based on configurable policies.
- Encryption: GPG encryption to secure your backup data.
- Notifications: Alerts for backup status (success or failure).
- Simple Setup: Minimal configuration required with an easy-to-use Docker container.
- Recurring Backups: Schedule regular backups or execute manual one-off backups.
- Automated Backups: Set up recurring backups or run manual backups as needed.
- Backup Rotation: Automatically manage and rotate old backups to save space.
- Secure Backups: GPG encryption ensures your backup data is safely stored.
- Notifications: Receive alerts for successful or failed backup attempts.
7- Docker Volume Backup
docker-volume-backup
is a Docker image designed for simple and reliable backups of Docker volumes. It supports automatic and manual backups to local disks, remote hosts (via SCP), and AWS S3. You can schedule backups with cron expressions and ensure consistent backups by optionally stopping containers during the process.
Features
- Automatic and Manual Backups: Backups can be scheduled using cron expressions or triggered manually.
- Multiple Backup Destinations: Supports backups to local disk, remote host via SCP, and AWS S3.
- Container Consistency: Optionally stops containers during backups for consistent data.
- Pre/Post-Backup Commands: Allows execution of commands before or after backups, perfect for database backups.
- Customizable Execution: Executes commands inside the backup container or on remote hosts.
- Backup Monitoring: Sends backup metrics to InfluxDB for monitoring and analytics.
- Backup Encryption: Optionally encrypts backups with GPG for security before uploading.
8- Docker Volume Backup
docker-volume-backup
is yet another simple command-line tool designed to back up and restore Docker container volumes.
The tool automates the process of stopping containers, backing up their volumes, and then restarting them. It works by creating tarball backups of specified container volumes and allows for easy restoration from these backups.
Features
- Backup and Restore: Easily back up and restore Docker volumes.
- Automatic Container Handling: Automatically stops and restarts containers to ensure consistent backups.
- Flexible Backup Locations: Store backups in a custom directory.
- Partial Restore: Restore only the available volumes if some backups are missing.
- Simple Commands: Backup and restore are done with a few simple commands.
Backup Process:
- The tool automatically stops the containers to ensure data consistency during the backup process.
- It backs up all volumes associated with the specified containers to tarballs in the current directory (or a specified location).
- Once the backup is completed, the containers are restarted.
- If multiple containers are specified, the containers are backed up in order, and the containers are restarted in reverse order.
Restore Process:
- For restoring, the tool uses the backup tarballs and extracts the contents back to the specified volumes.
- If the backup folder doesn’t contain a backup for every volume, it performs a partial restore, backing up only the volumes with available backups.
To install docker-volume-backup
, you can either use npm or build it from source.
- Install via npm:
npm install -g docker-volume-backup
Take a backup
docker-volume-backup backup my-app my-db -o /path/to/backup/
Restore Backup
docker-volume-backup restore my-app backup/my-app-2021-01-03-23-47-25
9- Digital-ocean-auto-volume-backup
A fellow DigitalOcean user created this tool to back up his Docker volumes to a secure location. However, the concept works the same with any server.
10- Docker Volume Backup
This is a custom Docker image backups docker volumes to minio server.
Requiring more Backup tools for your Web projects and Docker containers/ volumes as well as disk backups? Check out our other articles and free app collections here: