Scheduled synchronization of iCloud photo library in Synology

Prepare user directory services and permissions

Installing the Photos component will require the use of this service, which is theoretically enabled.

Open Control Panel > User & Group > Advance, scroll to the bottom and check Enable user home service.

Switch to File Services > NFS, check Enable NFS service.

And then switch to Shared Folder, select homes and press the Edit button, switch to NFS Permissions and click Create, fill values like the below screenshot.

Create an NFS rule

Prepare files and docker compose

Open File Station, create these directories:

docker/icloudpd/[email protected]
homes/user/Photos/iCloud

and these files:

homes/user/Photos/iCloud/.mounted

Open Container Manager and create a project and docker-compose.yml

It is not recommended to modify user and group because the user mapped after nfs mounting has been set to admin. Just keep it consistent.

version: "3.x"

services:
  user_example.com:
    image: boredazfcuk/icloudpd:latest
    container_name: icloudpd_user_example.com
    network_mode: bridge
    hostname: iCloudDownloader
    restart: unless-stopped
    privileged: true
    environment:
      - user=admin
      - user_id=1024
      - group=users
      - group_id=100
      - [email protected]
      - authentication_type=2FA
      - synchronisation_interval=43200
      - skip_check=true
      - download_path=/mnt/Photos/iCloud
      - icloud_china=true
      - auth_china=true
      - synology_ignore_path=true
    volumes:
      - /volume1/docker/icloudpd/[email protected]:/config
      - user_example.com:/mnt

volumes:
  user_example.com:
    driver: local
    driver_opts:
      type: nfs
      o: addr=10.0.0.1,rw
      device: :/volume1/homes/user

Start and configure 2FA login

Wait for the container icloudpd_user_example.com to start, click the Action button and click Open terminal.

Wait for Restarting in 5 minutes… to appear, click the Create button, and execute the following command.

docker exec -it icloudpd_user_example.com sync-icloud.sh --Initialise

Then follow the prompts to log in.