Skip to content

Backup & Restore

Incus Backups with Borgmatic

Incus containers and storage volumes are backed up nightly to BorgBase using borgmatic. This page documents how to restore a container or volume from those backups.

Borgmatic Configuration

/etc/borgmatic/config.yaml
source_directories:
    - /var/backups/incus
exclude_patterns:
    - /var/backups/incus/downloads.tar

repositories:
    - path: ssh://qbe8dyj9@qbe8dyj9.repo.borgbase.com/./repo  # (1)!
      label: "incus on BorgBase"
  1. Replace with your own BorgBase repository URL.

Mount the Borg Repository

Create a mount point

mkdir /mnt/borg

Mount the repository

borgmatic mount --repository ssh://qbe8dyj9@qbe8dyj9.repo.borgbase.com/./repo --mount-point /mnt/borg

The archives will appear as directories under /mnt/borg, named by timestamp, for example incus-2026-03-17-050449.

Browse the archive

cd /mnt/borg/incus-2026-03-17-050449/var/backups/incus

You will find container exports (.tar) and storage volume exports (.tar) here.

Restore an Incus Container

To restore a container from a .tar export:

Import the container

incus import /mnt/borg/incus-2026-03-17-050449/var/backups/incus/miniflux.tar  # (1)!
  1. Replace miniflux with the container name you want to restore.

Restore an Incus Storage Volume

To restore a storage volume, first delete the existing volume, then import from the backup:

Delete the existing volume

incus storage volume delete <pool> navidrome_var_lib_navidrome  # (1)!
  1. Replace <pool> with your storage pool name, and the volume name as appropriate.

Import the volume from backup

incus storage volume import <pool> /mnt/borg/incus-2026-03-17-050449/var/backups/incus/navidrome_var_lib_navidrome.tar  # (1)!
  1. Replace <pool>, the archive path, and the volume filename as appropriate.

Stop the container first

Before deleting and reimporting a storage volume attached to a running container, stop the container first to avoid data corruption.

Unmount the Borg Repository

Once done, unmount the repository to release the FUSE mount:

Unmount the Borg repository
borgmatic umount --mount-point /mnt/borg

Related Documentation: