Blog

I’m lazy. And over the years, I grew very comfortable with certain features and services. One of these is Apple Photos in combination with iCloud photos. We’ve been using it for years. In the life before that, I used Piwigo. But I stopped using my own Piwigo instance in 2021 for good.

Recently, I got the urge (doh — guess why ;) ) to revisit taking this into my own hands again. Especially since I’m “dual-devicing” (is that a term?) with a de-googled Fairphone that I run alongside my iPhone. Actually: the Fairphone is my main phone currently (different story; will dive into that in a separate post).

I came across this blog post that got me curious about immich.

Enter immich

Immich is a self-hosted photo (and video) solution that is openly developed and licensed under the AGPLv3. Furthermore, the whole ecosystem, such as mobile applications, are also open source and licensed accordingly. Apps are available for iOS as well as Android. For Android, the immich app is available via F-Droid as well. Immich is family-compatible and not just a fiddly-nerd solution :).

It is easily deployable as a set of Docker containers via docker compose. This is one of the recommended ways of setting up immich. The documentation is good so that there is no need to replicate it here.

Importing to immich

Importing to immich is — thanks to the immich-cli — effortless. The cli allows for recursive importing, and thanks to detecting duplicates it can also rerun multiple times. The following example will import the local directory ./export and everything below it to the immich instance available at immich-server:2283 (which in my case is the instance of immich running on the same host in Docker).

$ docker run -it -v "$(pwd)":/import:ro -v ./export:/upload:ro -e IMMICH_INSTANCE_URL=http://immich-server:2283/api -e IMMICH_API_KEY=$IMICH_API_KEY --network immich_network ghcr.io/immich-app/immich-cli:latest upload /upload --recursive --album

The --album will cause immich-cli to create an album named the same as each directory.

Before importing is exporting

For exporting from Apple Photos, the best way is to use osxphotos. A command line like this will do:

$ osxphotos export yourFolder --skip-original-if-edited --sidecar XMP --touch-file --directory “{folder_album}” --download-missing

For importing my piwigo-data, I just used the data directory from my piwigo install, there I already had all the photos in a directory structure resembling my albums.