Skip to content

Backups

TL;DR / when to use this: Two backup layers, each with a different job: Kopia for file/snapshot backups (deduplicated, browsable snapshots of app data), and cron dump containers for true database backups. Backing up a live database volume mount can produce corrupted backups — the container must be stopped first, which 24/7 containers never are. Dumps are the correct pattern for databases. For whole-VM image backups, use Proxmox Backup Server.

Kopia — file/snapshot backups

Attach an external drive (NTFS if you want Windows compatibility for restores) and mount it permanently:

lsblk -o NAME,MOUNTPOINT,UUID,FSTYPE,SIZE   # note the UUID
sudo nano /etc/fstab
UUID=3ED8D736D8D6EAE3  /mnt/external_drive  ntfs-3g  defaults,uid=1000,gid=1000,nofail  0  2
sudo mount -a          # umount first if it complains about already-mounted

Docker compose (web UI on 51515):

services:
  kopia:
    image: kopia/kopia:latest
    container_name: Kopia
    restart: unless-stopped
    ports:
      - 51515:51515
    command:
      - server
      - start
      - --disable-csrf-token-checks
      - --insecure
      - --address=0.0.0.0:51515
      - --server-username=${USERNAME}
      - --server-password=${SECRET_PASSWORD}
    environment:
      KOPIA_PASSWORD: ${SECRET_PASSWORD}
      USER: ${USERNAME}
      TZ: America/Denver
    volumes:
      - /mnt/external_drive/kopia/kopia-repo:/repository   # repository lives on the external drive
      - /mnt/md0/apps:/apps:ro                             # source data, READ-ONLY
      - /mnt/md0/restore:/restore
      - ./app/config:/app/config
      - ./app/cache:/app/cache
      - ./app/logs:/app/logs
      - ./data:/data:ro
      - ./tmp:/tmp:shared

Key points:

  • The repository path inside the container is /repository — create the repo in the UI pointing there.
  • Mount source data :ro — Kopia should read, never touch, the originals.
  • Create a snapshot per source folder (e.g. /apps/immich-app); hit Estimate first to confirm the mount resolves and the size looks right.

Database dumps (cron containers)

For live databases, run a sidecar container that dumps on a schedule:

Both run mysqldump / pg_dump on a cron interval into a mounted backup folder, so you get consistent, restorable SQL dumps without ever stopping the database container. Point the backup volume at the same external drive Kopia uses, and set the cron schedule + retention in the container env (see each repo's usage docs).

Which layer for what

Data Tool Why
App files (Immich uploads, documents) Kopia Deduplicated snapshots, browsable restore
Databases Dump containers Consistent dumps; volume copies of live DBs can corrupt
Whole VMs/LXCs PBS Image-level, verified snapshots

See also