← All posts

Keeping a useful photo library with Immich

I want to keep control of my photos, and I want to actually find and enjoy them. You can achieve the first part with a directory full of files. The second gets a bit harder once you're trying to remember which year something happened.

Immich supplies the application around that collection: browsing, albums, search, and background processing that makes the library easier to navigate. Running it myself lets me choose the infrastructure holding the files and the service presenting them.

I love using it, and family use it too. Being able to inspect and change what happens behind the interface is a freedom I wouldn't have with Google Photos. I also don't want a provider's mistaken account decision to cut off access to the collection. Running it myself leaves me responsible for keeping it safe.

Putting the files and application together

In my setup, Immich reads its library through an NFS network file share on TrueNAS, my network-attached storage server (NAS). PostgreSQL holds application state, and Authentik provides shared sign-in.

Those pieces need to be considered together. Having the original photos is essential, but recovering the application also involves its database and configuration. Restoring a folder of images alone does not establish that the previous library experience has been recovered. Its database backups also depend on Garage, so that storage service forms part of the recovery path.

The photo library and database do not need the same storage. The library needs shared file access, while the PostgreSQL instances managed by CloudNativePG, a Kubernetes database operator, use local-path volumes backed by the nodes' own disks and database replication. This lets the database use local disk performance without forcing the photo collection onto the same storage design. It also means I must understand two recovery paths within one application.

The division lets application processes run separately from the storage holding the collection. In exchange, accessing photos depends on the network path to the NAS as well as the application itself.

Immich application
    |          |
    v          v
Photo files   PostgreSQL state
on TrueNAS    on local node disks
    |          |
    |          v
    |       backups in Garage on TrueNAS
    +----------+
          |
     off-site recovery path

Different storage paths still share the building, much of it the same room. A phone upload or successful database backup does not by itself establish an independent recoverable collection.

Making processing manageable

Importing and processing photos takes resources. Thumbnail generation, face detection, and search indexing can compete with the work of serving someone browsing the library.

Indexing workloads hit memory limits and caused server restarts in this setup. The deployment now separates processes handling API requests from background workers that process the photo library. That separation gives the two kinds of work different scaling controls. Adding more processes to answer requests no longer automatically starts more indexing workers.

This is useful when a large processing backlog would otherwise make ordinary browsing unreliable. It adds operational detail, though: worker queues, memory limits, and database connection capacity all need attention. For a smaller library, the simpler upstream deployment may be entirely adequate.

Keeping the collection recoverable

A managed service would take much of that maintenance away. I accept the work for the control. Losing the collection is unacceptable to me; losing last night's server-side uploads may be tolerable if originals remain on clients. That fallback depends on the devices surviving and keeping their copies.

The most important follow-through is a backup strategy that covers both the photo files and the database, with a compatible recovery point and a restore test. Seeing successful jobs for each component separately is not enough to establish that they restore together.

The data-failure scenarios make the remaining checks concrete: recover a compatible database and original files from off-site data, without depending on the home NAS, then open representative photos and verify the application state. I have not demonstrated that complete room-loss recovery here. Public access also makes patching, account permissions, and containment after application compromise part of protecting the collection.

Immich is worth a look if you want a useful photo library on infrastructure you control. Start with enough processing capacity for your collection, keep the original files and database recoverable together, and don't assume that moving away from a provider finishes the backup job. The photos are why I'm doing this; I'd like to keep them.

← Back to the notebook