Valera Kushnir

Immich and iCloud Photo Downloader

When I recently built my home lab, one of my biggest goals was to get away from Google Photos and potentially iCloud. Synology Photos was pretty good, albeit slow due to Synology products being underpowered. But Immich has taken the FOSS world by storm, and is driving forward. Immich is by far the best photo library replacement today.

Wow, that paragraph above is a pretty strong statement, but with one flaw: uploading your existing library through mobile app is very, very slow due to how iOS handles background processes. They do have it on their roadmap to improve, so keep an eye on this if you're interested.

This post is less about Immich and more about iCloud Photo Downloader. It's probably the most useful container in my home lab set up.

What is it?

iCloud Photo Downloader is a CLI tool that allows to pull down photos from iCloud on the daily schedule to your local storage. This is by far the simplest solution that I have discovered so far for daily back ups. It is a pretty robust solution with more features outlined in their documentation.

Using iCloudPD

My objective is the following:

  1. Download iCloud photos to my Unraid server.
  2. Use the downloaded files as a local back up. (use copy not sync mode).
  3. Use the downloaded photos as an external library in Immich.

Unraid set up

Although iCloudPD is a CLI tool, thanks to the community there is a prebuilt Docker image available on Unraid Community Apps.

Set up is pretty straightforward:

  1. Search by the container name icloudpd icloudpd container in Unraid
  2. For Apple ID variable enter your Apple associated email address.
  3. For AppData Config Path add a path where you want to store the container settings.
  4. For Synchronization Interval (seconds) set frequency of sync.
    1. Keep in mind, the setting is in seconds. I have mine set to once every 24 hours which is 86400 seconds.
  5. For Data define where you want the photos to be stored. Container settings

These are all the required variables. Once installed, click on the icon in your docker container list in Unraid and open console.

Open container console

Initialize the copy process with sync-icloud.sh --initialise, enter your iCloud credentials, and you're off to the races!

Immich External Library

I'm running Immich in Docker on Unraid as well, so one tweak we need to make is to point Immich to the same location where we are storing our iCloud files. Updating Immich path for external library

Afterwards, in Immich Administration setting, add the library under External Libraries. Adding external libary in Immich

In Summary

So this is what we have now:

  1. We are copying iCloud files to our local server daily.
  2. We allow Immich to scan these files as part of external library and we can view them through Immich apps.
  3. We can now consider eventually removing these photos as an External Library and utilize Immich Upload CLI to import all these files without relying on the slow iOS App background upload.

#dabbling #homelab #tech