freedzhost.cloud

Homelab 7: replace Google Photos with Immich

Immich is the open-source photo and video library that comes closest to Google Photos: a phone app that backs up in the background, albums, shared links, a map, face recognition and search by content, all computed on your own machine. It is also the service where a careless setup loses the most: years of photos.

Phone appbacks up in the backgroundImmichserver + recognitionHTTPSDatabasealbums, faces, datesPhoto folderthe originalsYour backupdaily dump, 14 keptyou copy it
Two things make a photo library: the files, and the database that knows albums, faces and dates. Immich dumps the database every night; the files you must copy yourself. One without the other restores nothing useful.

A bit of history

Immich was started in 2022 by Alex Tran, who wanted his family's photos off a commercial cloud without giving up its comfort: automatic backup from the phone, faces, places, search by content. It grew into one of the most active self-hosted projects, and its development has been funded since 2024 so that it stays free and open source.

1. Install, the official way

Immich publishes its own compose file and environment template with every release. On a VM with Docker (Homelab 1), in an empty folder:

wget -O docker-compose.yml https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
wget -O .env https://github.com/immich-app/immich/releases/latest/download/example.env

Then edit .env:

docker compose up -d

Publish it through your HTTPS proxy (Homelab 2), create the administrator account, then install the Immich app on your phone and point it at your address.

2. The two things to back up

A photo library is the files and the database that knows the albums, the faces, the dates and who shared what. Immich dumps its database automatically every night at 2:00 and keeps the last 14 dumps, in UPLOAD_LOCATION/backups. It does not back up your files: that part is yours. Copy the whole of UPLOAD_LOCATION every night, to another machine (Homelab 5).

If you cannot stop the server during the copy, the official order is: database first, files second.

3. Restore, once, to see

On a fresh install, put the old files back in the new UPLOAD_LOCATION, start Immich, and choose Restore from backup on the welcome screen. Do it once on a test machine before you need it.

Traps

If the photo folder sits on a separate disk mounted into the VM, the hypervisor's VM backups do not include it. Check what your backups really contain: the library is often the largest and the least covered.

The first face recognition and indexing pass over a large library runs for hours on the processor. Let it run, or point the machine-learning container at a graphics card.

On Android, the background backup stops if the system puts the app to sleep: exclude Immich from battery optimisation.

Sources

Found this useful? Tell us what to measure next.