Skip to content

Immich & Data Backups

  • Service: High-performance photo and video backup.
  • Internal Port: 2283
  • Compose Location: /home/parth/docker/immich/

🏗️ Architecture Note

Immich utilizes an ML container, Valkey (Redis), and a pgvector-enabled PostgreSQL database.

⚠️ CRITICAL DEPENDENCY: The immich_postgres and immich_redis containers are shared with Nextcloud. If you take down the Immich stack, Nextcloud will also go offline.

💾 Storage Locations

  • Media Storage: Set via UPLOAD_LOCATION in .env.
  • Database: /home/parth/docker/immich/immich_database (Mounted via local bind).
  • ML Cache: /home/parth/docker/immich/immich_cache (Mounted via local bind).
  • Database Dumps: Clubbed in within immich-data/backups.

🛡️ Backup Strategy & Automation

Data is protected via a 3-tier backup strategy using Cron, Rclone, and Kopia.

1. Offsite Backblaze B2 Sync (Daily at 21:00)

A user cron job pushes the raw Immich data directly to a Backblaze B2 bucket using rclone. It utilizes a file lock (/tmp/rclone_backup.lock) to prevent overlapping syncs.

rclone sync /home/parth/immich-data/immich-data b2-backup:parth-server-backup/immich --fast-list --track-renames --transfers 10

2. Local Redundancy Sync (Daily at 23:00)

A secondary local rsync mirrors the Immich data to the larger /data drive.

rsync -a --delete /home/parth/immich-data/immich-data/ /home/parth/data/immich/library/

3. Kopia Server Snapshots

The kopia container runs constantly on port 51515. It mounts /home/parth as read-only (/data:ro) to safely snapshot server configurations, Docker compose files, and scripts without risking data corruption.