A Docker volume backup manager that allows you to easily backup and restore Docker volumes via CLI.
- Backup volumes: Create compressed backups of Docker volumes
- Restore volumes: Restore volumes from backup files
- Custom naming: Assign custom names to backup files
- Volume listing: List all available Docker volumes
- Force restore: Overwrite existing volumes when restoring
Use the provided installation script for the easiest setup:
# Clone the repository
git clone <repository-url>
cd volumeup
# Run the installation script
./install.sh
# Or with options
./install.sh --force # Force reinstall
./install.sh --quiet # Quiet mode
./install.sh --help # Show helpThe installation script will:
- Check prerequisites (Ruby, Bundler, Docker)
- Install dependencies from Gemfile
- Build the VolumeUp gem
- Install the gem system-wide
- Verify the installation
- Clone the repository:
git clone <repository-url>
cd volumeup- Install dependencies:
bundle install- Build and install the gem:
bundle exec rake build
gem install pkg/volumeup-0.1.0.gemYou can also run the tool directly without installing:
bundle exec bin/volumeup --helpTo remove VolumeUp from your system:
# Using the uninstall script
./uninstall.sh
# Or manually
gem uninstall volumeup# List only manually created volumes (default)
volumeup list
# List all volumes including auto-generated ones
volumeup list --all# Basic backup
volumeup backup my_volume /path/to/backup/directory
# Backup with custom name
volumeup backup my_volume /path/to/backup/directory --name my_custom_backup
# Verbose output
volumeup backup my_volume /path/to/backup/directory --verbose# Basic restore
volumeup restore /path/to/backup/my_volume_20240101_120000.tar.gz my_volume
# Force restore (overwrite existing volume)
volumeup restore /path/to/backup/my_volume_20240101_120000.tar.gz my_volume --force
# Verbose output
volumeup restore /path/to/backup/my_volume_20240101_120000.tar.gz my_volume --verbosevolumeup version# 1. List manually created volumes
volumeup list
# 2. Backup a volume
volumeup backup postgres_data ./backups --name postgres_backup_$(date +%Y%m%d)
# 3. Restore the volume (with a new name)
volumeup restore ./backups/postgres_backup_20240101.tar.gz postgres_data_restored# Backup multiple volumes with timestamps
for volume in postgres_data redis_data app_data; do
volumeup backup $volume ./backups --name ${volume}_$(date +%Y%m%d_%H%M%S)
done- Ruby 2.7 or higher
- Docker daemon running
- Docker API access
- Validates that the source volume exists
- Creates a temporary Alpine Linux container with the volume mounted as read-only
- Uses
tarto create a compressed archive of the volume contents - Copies the archive to the specified backup location
- Cleans up the temporary container
- Validates that the backup file exists and is readable
- Checks if the target volume already exists (unless
--forceis used) - Creates the target volume
- Creates a temporary Alpine Linux container with the volume mounted
- Extracts the backup archive into the volume
- Cleans up the temporary container
The tool provides clear error messages for common issues:
- Volume not found
- Backup file not found or not readable
- Volume already exists (when restoring without
--force) - Docker daemon not accessible
- Permission issues
bundle exec rspecbundle exec rake buildThe project includes convenient installation scripts:
-
install.sh- Automated installation script with options:--help- Show help message--force- Force reinstall even if already installed--quiet- Quiet mode (minimal output)
-
uninstall.sh- Automated uninstallation script with options:--help- Show help message--yes- Skip confirmation prompt--quiet- Quiet mode (minimal output)
MIT License - see LICENSE file for details.