Series Intro (Hacking Immich): After testing several mainstream open-source photo managers, I settled on Immichâthen used AI to rewrite everything from its deployment architecture to its core logic.
(Note: Huge respect to the Immich team. Upstream's defaults make complete sense for a multi-user, Docker-first product. This is purely a single-user Windows fork tailored to my own hardware and habits.)
TL;DR â What I actually changed across ~200K assets:
- Half-Native Windows Setup: Kept Postgres/Redis/ML in Docker, pulled
immich-server out to run natively on Windows. Directory scans dropped from 26s â 11s (for 2.3x more files), Vmmem RAM usage dropped from 97%, and 4K 60fps transcoding jumped 8x (0.4x â 3.2x via native HW codec). - Path Hashing + pHash Deduplication: Replaced slow content-stream hashing on scans with file-path hashing, and rebuilt the deduplication UI around perceptual hashing (pHash/dHash), flagging 32.4 GiB to reclaim.
- Rewritten Upload Pipeline + In-Place Compression: Replaced serial mobile uploads with 20-item / 200 MB sequential batches to saturate LAN bandwidth without thrashing HDD heads, plus pre-upload JPEG 85 in-place compression (
1/2â1/10 size). - Native Incremental Backup + 4K Video Compression: Built automatic incremental disk backup into Immich (skipping a separate NAS) and added an automated H.265 video compression pass that reclaimed 1.7 TiB.
- No More "Never Touch Originals" + Quality-of-Life Fixes: Safe temp-file + integrity-checked write-back for rotations/GPS, instant permanent delete (skipping Trash), mirrorless SD card import workbench,
Province â City Places tree, canonical EXIF camera/model names, and auto-archiving screenshots/social downloads.
1. Why I Left Google Photos
I didn't get into self-hosting photos for fun. I did it out of fear.
Once you get used to Google Photos, it's hard to go back: the timeline is buttery smooth, Memories hit the spot, and search finds whatever you ask for. Still, the more I stored there, the more uneasy I felt.
Privacy aside, there have been way too many stories of accounts getting banned out of nowhereâone automated risk flag, no real appeal process, and over a decade of photos and videos vanish overnight. Keeping your memories on someone else's servers is basically renting an apartment: no matter how nicely you decorate it, if the landlord changes the locks one day, you don't even get a chance to pack your bags.
Beyond ban anxiety, two dealbreakers drove me crazy:
- Syncing was painfully slowâpractically at a crawl.
- Video compression was way too aggressive.
So I decided to bring everything home and self-host.
2. Testing Open-Source Alternatives: Why I Picked Immich
First, I spun up PhotoPrism. Written in Go, it's rock-solid under the hood with thorough RAW decoding and classification. Still, I gave up in under three days: the UI feels aggressively "engineer-brained." Filenames, shooting parameters, tags, and status icons are all crammed directly under every thumbnail. Scrolling through old photos in bed to unwind felt like auditing a spreadsheet after hours.
Next, I tried Lap, a newer local-first Rust + Tauri client. I closed it almost immediatelyâsame visual rigidity, plus it's a pure local desktop app with no mobile app or server sync. A photo app is something you look at every day; if the first impression puts you off, features alone won't save it.
After making the rounds, I landed on Immich. Its UI benchmarks cleanly against Google Photosâuncluttered timeline, generous whitespace, and zero lag scrolling through tens of thousands of shots. It finally felt like bringing a cloud gallery home.
| Dimension | Google Photos | Immich | PhotoPrism | Lap |
|---|
| Architecture | Commercial cloud | Open-source C/S | Open-source Web-first | Local desktop (Rust+Tauri) |
| UI / UX | Minimalist benchmark | Clean Google-style | Dense, metadata-heavy | Utility / file-manager feel |
| Mobile Sync | 5/5 (Seamless) | 5/5 (Native app) | 3/5 (PWA / 3rd-party) | None |
| AI & Search | Cloud LLMs (Top tier) | CLIP + face recognition | Classic tag/EXIF filters | On-device local AI |
| Folders | Forced upload | External libraries | Read-only mount | Direct local read |
| RAW / Live | Basic | Great (stacking + 360°) | Great (RAW color) | Great (RAW+JPG/XMP/Live) |
| Verdict | Easy, but ban/privacy risk | Best UI + modding base | Solid, visually tiring | Great local tool, no sync |
3. Overturning Immich's Core Design Principles With AI
Once I dumped all my daily phone shots, camera RAWs, and videos into Immich as my primary gallery, the rough edges showed up fast. Years ago, if an open-source app didn't fit your workflow, you filed a GitHub issue and waited. Now with AI coding alongside me, I cloned the repo and reshaped it around my hardware and habitsâoverturning almost every core assumption of upstream Immich while keeping its clean UI shell.
1. Going Half-Native, Half-Docker to Cut I/O Overhead
Docker-all-the-things is convenient, until you run it on Windows (WSL2 9P) over a 200K-file library. Filesystem and block I/O overhead became painfully obvious when reading/writing large images and videos, and got even worse once I added compression and backups.
So I left PostgreSQL, Redis, Machine Learning, and Map Tiles inside Docker for clean dependency management, and pulled immich-server out to run natively on the Windows host.
| Benchmark | Full Docker (WSL2 9P) | Half-Native (Windows Host) | Difference |
|---|
| Directory Traversal | 26s for 86K files (cold cache 100K+ hits 5â15m) | 11s for full 198K disk files | Order-of-magnitude speedup |
| Asset Stat Check | 18s for 86K assets over 9P | 6s for 201K assets (11s incl. walk) | Zero cross-VM round trips |
| Same-Disk Move / Metadata | EXDEV re-copy; 4â8 GB r/W for a 2 GB video | Atomic rename (< 1 ms), fast local write | Zero duplicate copies |
Cross-Disk Backup (E: â F:) | Double 9P round-trip; frequent timeouts | Direct copy at 82â172 ms / photo | 5â15x faster, 0 timeouts |
| Delete Large Files | >512 MB crawls over 9P; forced .trash | Native DeleteFileW: few ms for 10 GB | Instant space reclaim |
Memory (Vmmem) | I/O cache spikes to 33.8â37.7 GB (97% RAM) | Heavy I/O moved out; host free RAM rebounds to 31.2 GB | Stops starving host RAM |
| 4K 60fps Transcode | Slow Windows HW / no macOS VideoToolbox (0.4x SW) | Native HW codec at 3.2x (CPU < 15%) | 8x faster, cool & quiet |
2. Dropping Content Stream Hashing for Path Hashing & Rebuilding Deduplication
Upstream Immich reads the entire byte stream of every new file to compute a content hash, and re-hashes aggressively during scans. On large 4K videos and massive libraries, that thrashes disk I/O. Since I manage my own folders, I replaced content-stream hashing with file-path hashing (dropping scan verification to milliseconds) and rebuilt duplicate detection using perceptual hashing (pHash / dHash)âfast, accurate, and resilient to EXIF edits or resolution compressionâalong with a completely rewritten deduplication UI.
3. Throwing Out the Upload Pipeline and Starting From Scratch
Stock mobile upload was agonizingly slowâtaking seconds per photo over local Wi-Fi when I could just blast files via LocalSend and scan them. Why? Because mobile backup defaults to serial single-file uploads (waiting on server handshake/verification/preprocessing for every single asset). Cranking up concurrency doesn't help on HDDs either: multithreaded random writes send drive heads thrashing wildly.
So I gutted the upload flow:
- The server now writes directly into my External Library (not Immich's closed internal folder structure).
- The mobile app uploads in 20-item / 200 MB batches, firing the next batch immediately while decoupling synchronous blockingâturning chaotic random writes into smooth sequential HDD writes that saturate LAN bandwidth.
- Pre-upload in-place image compression: Wrapped mature compression code from my Android work into a Flutter plugin that re-encodes photos in-place at JPEG quality 85 (
1/2â1/10 file size, same resolution, virtually zero visible quality loss) before uploadingâsaving phone space, upload time, and server disk simultaneously.
4. Adding Native Incremental BackupâAnd Skipping a Dedicated NAS
I wired automated incremental disk backup directly into Immich. Once it worked, I realized I don't even need a dedicated NAS box anymore.
Most home NAS setups store movies, e-books, and family photos/videos. Movies and books can always be re-downloaded; the only truly irreplaceable data is what you shot yourself. Historically people bought a NAS because gallery software didn't handle disaster-recovery backups. With this half-native Windows Immich handling management and incremental backups in one loop, having one less box and OS to maintain is actually a huge relief.
5. Automated Video Compression: 1.7 TiB Reclaimed Across 200K Assets
Checking disk usage revealed the real storage hog wasn't photosâit was straight-out-of-camera 4K video from mirrorless cameras, gimbals, and drones. A few minutes of high-bitrate footage eats gigabytes, even though I mostly rewatch clips on phones or monitors.
Test encodes showed I could shrink videos to 2/3 or even 1/10 of their original size with no resolution drop and practically zero visible difference. I built an automated H.265 compression pipeline (triggered post-upload, post-scan, or manually) that silently swaps in the compressed file. One pass across my ~200K-asset library reclaimed 1.7 TiB.
6. Plugging In My Mirrorless Camera Import Workflow
I shoot JPG + RAW on my mirrorless camera. Previously, importing meant running a custom Java script to rename/sort by date, batch-exporting JPGs from DxO PhotoLab, and manually scanning Immichâenough friction that photos sat on SD cards for months.
Now I added an SD card import workbench straight into Immich: one click copies to high-speed SSD staging, auto-renames, sends finished JPGs to the External Library, and archives RAWs to cold storage. After I hit batch export in PhotoLab, ingestion, compression, and backup run automatically.
7. Breaking the "Never Modify Original Files" Dogma + Instant Permanent Delete
This is the biggest philosophical break. Upstream Immich never touches original filesârotations and GPS fixes only go into .xmp sidecars or the DB. That makes no sense to me: if the original JPEG is sideways or missing GPS, opening it in File Explorer or another viewer leaves it just as broken. To prevent corruption, my write-back flow modifies a temp file, validates image decoding + EXIF integrity, and only then atomically replaces the original.
I also killed the mandatory Trash step. When culling bad shots, I don't want them lingering for 7â30 daysâI added a "Delete Permanently Now" action that wipes them from disk immediately on confirmation.
8. Fixing My Biggest Pet Peeves: Location Tree, EXIF Device Names & Timeline Cleanup
- Two-Level Location Tree: Upstream Places dumps cities/districts into a flat, unsorted list. I rebuilt it into a Province â City tree sorted by item count.
- Canonical Camera & Model Names: Upstream displays raw EXIF strings verbatim (inconsistent brand spellings and cryptic phone model codes). I added a normalization layer merging 49 raw EXIF variants into 37 canonical brands and mapping internal codes to readable consumer model names.
- Timeline Auto-Cleanup: Built an auto-archive ruleset matching filename patterns (
Screenshot_) and source folders (like Xiaohongshu/RedNote, Zhihu, Douyin, etc.) so saved guides, memes, and screenshots stay out of my main camera timeline.
4. What's Next?
What started as fear of losing a Google account ended with me using AI to reshape Immich around my exact hardware and workflow. There's no one-size-fits-all architectureâwhen a self-hosted tool bends cleanly to how you actually live and shoot, that's when it clicks đś.
This post is the high-level overview. I'm planning standalone deep dives with implementation details and pitfalls for:
- The half-native Windows architecture (
immich-server outside WSL2) - Sequential batch uploads + Flutter JPEG 85 in-place compression
- Path hashing + pHash/dHash deduplication
- Mirrorless camera SD card workflow
- Safe temp-file-verified write-back to originals
Which part are you most curious to see first? Happy to answer questions or share specifics in the comments.