Replacing Google Photos with Immich

・3 min read

I have, for a long time, been looking for a better alternative to Google Photos. Although Google Photos does exactly what I want, and isn’t that expensive, I do often consider the fact that all of my photos are in Google’s hands. I did move to Synology Photos a few years ago. The move itself was straight forward enough, but the user experience leaves quite a lot to be desired.

Anyone who has spent more than 5 minutes on any of Reddit’s self hosting and open source subreddits will have heard of Immich before. It’s open source, somehow done entirely by a sole developer, and has an impressive iOS app that matches Google Photos in feature set.

So, the first step was to take Immich for a spin and see how it performs. I followed the Immich docker compose documentation steps and it was basically effortless.

Google Takeout

Of course, Immich is only useful if it has my photos in it. Those photos are in Google’s hands at the moment. Thankfully, Google provide a very easy way to download all of my photos using Google Takeout.

Once I got the Google Takeout email from Google and downloaded them all, I used the GooglePhotosTakeoutHelper library to get the metadata from the Google JSON file and merge them into the image files themselves.

I then simply took the ALL_PHOTOS directory and uploaded everything via the Immich frontend. There are plenty of options available for the upload step, but I was happy with the simplest method of using the frontend uploader.

Performance

Immich doesn’t need much in the way of resources to run the day-to-day operations of the photo library. Where I started to hit performance issues was during the initial import. Immich has a number of ‘jobs’ that are undertaken when it detects new images. One of these jobs is the ‘detect faces’ job. This does exactly what you think it does. It uses the machine learning docker container to check if the image has any faces in it, and if so, marks them as faces and passes the information to the Immich microservice container which then attempts to identify who’s face has been identified.

As with most machine learning processes, this one is resource intensive.

Impressively, and equally helpfully, Immich has the ability to offload this machine learning process to another hardware stack. In my case, it’s simply my Macbook Pro (M2).

To get this working, I used the following docker-compose.yml file on my Macbook:

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich

services:
  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
       file: hwaccel.ml.yml
       service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always
    ports:
      - "3003:3003"

volumes:
  model-cache:

Then, after a simple docker compose up -d I then had the machine learning container running on my laptop. All I had to do then, was change the Immich setting to use the remote container.

Immich remote machine learning settings

The effect was immediate. My laptop was able to run through 5,000 images in around 30 minutes. For comparison it took around 10 minutes per image on the original virtual machine (running in Proxmox).

Summary

So far I’m pretty impressed with Immich. Let’s see how long I stick with it!