我的本地優先相片管理流程:Immich、Syncthing 與 rclone
My local-first photo workflow (Immich + Syncthing + rclone)
作者分享了以 Immich、Syncthing 和 rclone 建立的本地優先相片流程,在自有 NAS 上管理家庭相片與影片,並作異地備份。手機透過 Syncthing 同步至 NAS,rclone 則將資料加密備份至 Backblaze B2;Immich 負責瀏覽、搜尋和分享,並以唯讀方式索引原始相片。
After 4 years on Google Photos, I migrated everything to a self-hosted setup that gives me similar features with full data ownership. Here's the stack after 18 months of iteration.
The constraints I started with
- 50,000+ photos and videos (currently 280GB, growing ~30GB/year)
- Family of 4 sharing the same library
- Want to view/edit/share from any device (iOS, Android, web, laptop)
- Don't want to pay $100+/year for cloud storage
- Don't want my photos trained on by some AI model
The current stack
Storage: Synology DS220+ (8TB, RAID 1, ~5TB usable)
Photos backend: Immich (the best Google Photos replacement I've found)
Phone → NAS sync: Syncthing running on each phone
NAS → offsite backup: rclone + Backblaze B2 (encrypted)
Viewing: Immich iOS/Android apps + web UI
Total cost: $5/month Backblaze + the NAS I already owned. After 18 months: $90 total. Versus $100+/year to Google.
Why Immich, not PhotoPrism or PiGallery
I tried all three.
PhotoPrism is beautiful but slow on a Celeron. Face recognition took 3 days to scan my library. And the mobile apps are "functional but rough."
PiGallery is dead-simple but doesn't do face recognition, timeline is clunky, sharing is awkward.
Immich (github.com/immich-app/immich) hit the sweet spot:
- Fast face recognition (uses ML models on CPU but parallelized well)
- Clean iOS/Android apps that actually feel native
- EXIF data preserved
- Map view (if your photos have GPS)
- Sharing via signed links with optional password
- Search by face, by date, by location, by object (uses CLIP embeddings)
- Auto-upload from mobile
- Albums + Memories ("On this day X years ago")
Immich is a Google Photos clone in the best sense of the word.
The Docker Compose setup
version: '3'
services:
immich-server:
image: ghcr.io/immich-app/immich-server:release
container_name: immich_server
restart: unless-stopped
ports:
- "2283:2283"
volumes:
- /volume1/docker/immich/upload:/usr/src/app/upload
- /volume1/photos:/usr/src/app/external:ro
environment:
- TZ=Asia/Shanghai
immich-machine-learning:
image: ghcr.io/immich-app/immich-machine-learning:release
container_name: immich_ml
restart: unless-stopped
volumes:
- /volume1/docker/immich/cache:/cache
environment:
- TZ=Tokyo
redis:
image: redis:7-alpine
container_name: immich_redis
restart: unless-stopped
database:
image: postgres:14-alpine
container_name: immich_db
restart: unless-stopped
environment:
- POSTGRES_DB=immich
- POSTGRES_USER=immich
- POSTGRES_PASSWORD=<your-password>
volumes:
- /volume1/docker/immich/db:/var/lib/postgresql/data
External library /volume1/photos is mounted read-only — that's where my "archive" of original photos lives, and Immich indexes them without modifying the originals.
Phone upload via Syncthing (not Immich's auto-upload)
I tried Immich's built-in auto-upload. It works, but eats battery on iOS and occasionally misses photos when the app is backgrounded.
Syncthing is more reliable:
- Runs in background on both iOS and Android (via Syncthing-Fork / Möbius Sync)
- Pushes to
/volume1/phone-backup/<partner>/on NAS - A small cron job moves new files from there into Immich's upload dir
This way my wife's phone and my phone both auto-upload without either of us thinking about it.
Backup to Backblaze B2
#!/bin/bash
rclone sync /volume1/photos encrypted-b2:my-photos-backup --transfers 4 --checkers 8 --log-file /var/log/rclone-photos.log
Encrypted client-side (crypt remote in rclone config). B2 only sees ciphertext. Cost: ~$1.50/month for 280GB.
I run this weekly via cron. Restore is slow but works.
What's missing vs Google Photos
- Google Magic Eraser (AI object removal): Immich doesn't have this. For me, I rarely used it.
- Google Lens-style search: Immich's CLIP search is close but not as polished. You can search "beach" or "dog" and get reasonable results.
- "Cinematic moments" (slow-zoom video): Immich doesn't auto-generate these.
- Free unlimited "storage saver" quality: Immich stores full quality. If you want to downsample, do it on upload.
If you use these heavily, Immich isn't a 1:1 replacement. For me, the local-first trade-off is worth it.
What I like BETTER than Google Photos
- True data ownership: I can export everything tomorrow if I want to leave.
- No AI training on my kids' faces: This was a bigger motivator than I expected.
- Free unlimited storage (within my NAS capacity): No more "15GB shared with Drive."
- Family sharing without paying: Google charges $30/year for 2TB shared with family. My setup is $5/month total.
- Original files preserved: Google sometimes downgrades original quality. Immich doesn't touch them.
What I'd do differently if starting today
- Start with Immich. Don't waste time on PhotoPrism unless Immich doesn't work for you.
- Buy a NAS with at least 8TB usable (more than you think you need).
- Use Syncthing for upload, not Immich's built-in auto-upload. More reliable.
- Set up rclone backup BEFORE importing all your photos. Don't be me, importing 50k photos then scrambling to set up backup.
- Enable Immich's external library mode from the start. Lets you keep originals in a separate folder and not duplicate storage.
Hardware requirements
My Synology DS220+ (Intel Celeron J4025, 10GB RAM):
- 50k photos indexed: ~6 hours initial scan
- Face recognition: ~24 hours (uses ML container)
- Daily uploads (50-100 photos): instant
- Mobile app responsive: yes
- Web UI responsive: yes
- Search by object (CLIP): ~2-3 seconds per query
For larger libraries (100k+) or if you want faster face recognition, get a NAS with an Intel i5/i7 or add a GPU for ML inference.
Total cost over 18 months
| Item | Cost |
|---|---|
| Synology DS220+ (one-time) | $300 (already owned) |
| 2x 4TB HDD (one-time) | $180 |
| Backblaze B2 (monthly) | $1.50/mo = $27 |
| Domain (optional) | $10/year |
| Total 18 months | ~$220 |
Google Photos 2TB shared plan for the same period: ~$150 (similar).
The financial case isn't strong. The privacy case is. For me, that's enough.
來源:DEV Community · dev.to