VPS Snaps
Help/Backup Types/Docker volume backups

Docker volume backups

How VPS Snaps backs up Docker named volumes and compose files.

4 min readยท๐Ÿ’พ Backup Types

Docker backups archive your named volumes and optionally your docker-compose configuration files. VPS Snaps uses a temporary Alpine container to read volume data without interrupting running services.

Requirements

  • Docker installed and running on the server
  • SSH user must be in the docker group
  • Named volumes (not bind mounts) โ€” anonymous volumes are not backed up

Add your SSH user to the docker group: usermod -aG docker vpssnaps-backup

How it works

For each named volume, VPS Snaps spins up a temporary Alpine container, mounts the volume read-only, and creates a tar.gz archive. The archive is streamed off-server via SSH and uploaded to your storage bucket.

Docker Compose files

If you specify a compose file path in the job config, VPS Snaps will also back up that file alongside the volume archives. This means you can fully reconstruct your stack from the backup.

Restoring a volume

To restore a backed-up volume, download the tar.gz from your storage bucket and run:

# Create the volume if it doesn't exist
docker volume create myvolume

# Restore from backup
docker run --rm \
  -v myvolume:/target \
  -v /path/to/backup:/backup \
  alpine tar xzf /backup/myvolume.tar.gz -C /target