# Backup your iCloud photos to your Synology NAS (and even convert to .jpg) automatically with icloudpd via docker

**URL:** <https://forums.spacerex.co/t/backup-your-icloud-photos-to-your-synology-nas-and-even-convert-to-jpg-automatically-with-icloudpd-via-docker/1083>\
**Category:** YouTube\
**Tags:** video-suggestion\
**Created:** [August 11, 2023, 6:37pm UTC](https://forums.spacerex.co/t/backup-your-icloud-photos-to-your-synology-nas-and-even-convert-to-jpg-automatically-with-icloudpd-via-docker/1083 "2023-08-11T18:37:57Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![syl](https://forums.spacerex.co/letter_avatar_proxy/v4/letter/s/91b2a8/32.png) [@syl](https://forums.spacerex.co/u/syl)\
**Post date:** [August 11, 2023, 6:37pm UTC](https://forums.spacerex.co/t/backup-your-icloud-photos-to-your-synology-nas-and-even-convert-to-jpg-automatically-with-icloudpd-via-docker/1083/1 "2023-08-11T18:37:57Z")

</div>

You recently posted a video about syncing google drive / dropbox

# Sync Google Drive / Dropbox to your Synology NAS - Cloud Sync Tutorial

Loved it, as usual. I made a comment about the inability to sync iCloud photos which was my #1 wish. You replied it is possible to do somehow with an iPhone, but I went looking and found [icloudpd](https://github.com/boredazfcuk/docker-icloudpd), which can be run in docker on a Synology NAS.

It’s excellent. I found it via a [reddit post by onestix](https://www.reddit.com/r/synology/comments/ume5jh/comment/i818is2/?utm_source=share&utm_medium=web2x&context=3) made a year ago. How come I haven’t heard about it (and you haven’t made a video about it) before?

There’s not that much about it on YouTube, and there’s not even that much written about it on forums, especially for use with a Synology NAS.

It can regularly backup your icloud photos to your Synology NAS, and then you can use your NAS to index them (great that it now does objects as well as people BTW).

My workflow was:

(Install Portainer on the NAS if you don’t have it)  
Create a directory in your docker directory for the config file  
Create a directory in your photo folder for icloud photos  
Create a .mounted file in that photo folder (easy to miss that in the git instructions)  
Create a stack in Portainer (see below for mine)  
Deploy the stack  
Log into the container console (/bin/sh) via Portainer and run the authorisation  
/usr/local/bin/sync-icloud.sh --Initialise  
Then it starts downloading!  
It will even convert .heic to .jpg if you tell it to!

You can find your user ID by SSHing into the NAS and typing “id”.

```auto
version: '3.3'
services:
    icloudpd:
        container_name: icloudpd
        restart: always
        environment:
            - user=xxxxx
            - user_id=1026
            - group=users
            - group_id=100
            - apple_id=xxxxx@yyyyy.co.uk
            - authentication_type=2FA
            - 'folder_structure={:%Y/%m}'
            - notification_days=7
            - synchronisation_interval=86400
            - TZ=Europe/London
            - 'download_path=/icloud'
            - skip_check=false
            - convert_heic_to_jpeg=true
            - auto_delete=true
        network_mode: host
        volumes:
            - '/volume1/docker/icloudpd:/config'
            - '/volume1/photo/icloud:/icloud'
        image: boredazfcuk/icloudpd:latest

```

---

<div class="post-metadata">

**Author:** ![syl](https://forums.spacerex.co/letter_avatar_proxy/v4/letter/s/91b2a8/32.png) [@syl](https://forums.spacerex.co/u/syl)\
**Post date:** [August 11, 2023, 6:41pm UTC](https://forums.spacerex.co/t/backup-your-icloud-photos-to-your-synology-nas-and-even-convert-to-jpg-automatically-with-icloudpd-via-docker/1083/2 "2023-08-11T18:41:37Z")

</div>

And if you have two accounts, one for you and one for your wife, you just create two docker containers!

---

<div class="post-metadata">

**Author:** ![Will](https://forums.spacerex.co/user_avatar/forums.spacerex.co/will/32/14_2.png) [@Will](https://forums.spacerex.co/u/Will)\
**Post date:** [August 12, 2023, 12:37pm UTC](https://forums.spacerex.co/t/backup-your-icloud-photos-to-your-synology-nas-and-even-convert-to-jpg-automatically-with-icloudpd-via-docker/1083/3 "2023-08-12T12:37:57Z")

</div>

This is great info! Will have to look at it!

---

<div class="post-metadata">

**Author:** ![iklaatu](https://forums.spacerex.co/letter_avatar_proxy/v4/letter/i/ad7895/32.png) [@iklaatu](https://forums.spacerex.co/u/iklaatu)\
**Post date:** [August 14, 2024, 8:42pm UTC](https://forums.spacerex.co/t/backup-your-icloud-photos-to-your-synology-nas-and-even-convert-to-jpg-automatically-with-icloudpd-via-docker/1083/5 "2024-08-14T20:42:00Z")

</div>

Thanks for sharing this! I think I almost got it but don’t fully understand the .mounted line. Can you explain how I created and upload that file into the folder?

---

<div class="post-metadata">

**Author:** ![syl](https://forums.spacerex.co/letter_avatar_proxy/v4/letter/s/91b2a8/32.png) [@syl](https://forums.spacerex.co/u/syl)\
**Post date:** [August 14, 2024, 11:08pm UTC](https://forums.spacerex.co/t/backup-your-icloud-photos-to-your-synology-nas-and-even-convert-to-jpg-automatically-with-icloudpd-via-docker/1083/6 "2024-08-14T23:08:38Z")

</div>

The instructions say:

“I have added a failsafe feature to this container so that it doesn’t make any changes to the filesystem unless it can verify the volume it is writing to is mounted correctly. The container will look for a file called “/home/${user}/iCloud/.mounted” (please note the capitalisation of iCloud) in the download destination directory inside the container. If this file is not present, it will not download anything from iCloud. This way, if underlying disk/volume/whatever gets unmounted, sync will not occur and this prevents the script from filling up the root volume of the host. This file **MUST** be created manually and sync will not start without it.”

Create the file using a text editor or touch. It just has to exist. If it doesn’t then it won’t work and the log file will tell you that the .mounted file is missing.

---

<div class="post-metadata">

**Author:** ![iklaatu](https://forums.spacerex.co/letter_avatar_proxy/v4/letter/i/ad7895/32.png) [@iklaatu](https://forums.spacerex.co/u/iklaatu)\
**Post date:** [August 15, 2024, 1:17am UTC](https://forums.spacerex.co/t/backup-your-icloud-photos-to-your-synology-nas-and-even-convert-to-jpg-automatically-with-icloudpd-via-docker/1083/7 "2024-08-15T01:17:26Z")

</div>

Thanks for getting back to me. I’m in the container console (using portainer) and I’m getting a file directory not found error when I try to use touch and pasting what the instructions for.

Any idea what I’m doing wrong? Sorry I’m new to all this.

---

<div class="post-metadata">

**Author:** ![syl](https://forums.spacerex.co/letter_avatar_proxy/v4/letter/s/91b2a8/32.png) [@syl](https://forums.spacerex.co/u/syl)\
**Post date:** [August 15, 2024, 4:53am UTC](https://forums.spacerex.co/t/backup-your-icloud-photos-to-your-synology-nas-and-even-convert-to-jpg-automatically-with-icloudpd-via-docker/1083/8 "2024-08-15T04:53:05Z")

</div>

My personal volume mappings include:

```auto
        volumes:
            - '/volume1/docker/icloudpd-myname:/config'
            - '/volume1/photo/icloud/myname:/icloud'

```

(I run several icloudpd containers, one for each family member - I also ignored the capitalisation of iCloud when I set my path and hence my volume mounts)

My .mounted file is /volume1/photo/icloud/myname/.mounted on the NAS. Create a .txt file on the NAS and then rename it to .mounted. That’s probably the easiest way to create it and doesn’t need you to go into docker at all.

---

<div class="post-metadata">

**Author:** ![iklaatu](https://forums.spacerex.co/letter_avatar_proxy/v4/letter/i/ad7895/32.png) [@iklaatu](https://forums.spacerex.co/u/iklaatu)\
**Post date:** [August 15, 2024, 11:56pm UTC](https://forums.spacerex.co/t/backup-your-icloud-photos-to-your-synology-nas-and-even-convert-to-jpg-automatically-with-icloudpd-via-docker/1083/9 "2024-08-15T23:56:50Z")

</div>

Thanks! I ended up getting this working. Appreciate the reply to the one year post haha.

---

<div class="post-metadata">

**Author:** ![Norman](https://forums.spacerex.co/user_avatar/forums.spacerex.co/norman/32/1032_2.png) [@Norman](https://forums.spacerex.co/u/Norman)\
**Post date:** [September 6, 2024, 8:30pm UTC](https://forums.spacerex.co/t/backup-your-icloud-photos-to-your-synology-nas-and-even-convert-to-jpg-automatically-with-icloudpd-via-docker/1083/10 "2024-09-06T20:30:21Z")

</div>

Can you make a YouTube on this please

---

<div class="post-metadata">

**Author:** ![Vlad\_Bozantan](https://forums.spacerex.co/user_avatar/forums.spacerex.co/vlad_bozantan/32/1219_2.png) [@Vlad\_Bozantan](https://forums.spacerex.co/u/Vlad_Bozantan)\
**Post date:** [February 5, 2025, 10:44pm UTC](https://forums.spacerex.co/t/backup-your-icloud-photos-to-your-synology-nas-and-even-convert-to-jpg-automatically-with-icloudpd-via-docker/1083/11 "2025-02-05T22:44:52Z")

</div>

works great on my synology ! Great writeup ! I`ve used container manager to build the docker-compose however I still had to use portainer (agent) in my case to access the /bin/sh for the auth process …

I hope this project will be maintained !

---

<div class="post-metadata">

**Author:** ![Kominos](https://forums.spacerex.co/user_avatar/forums.spacerex.co/kominos/32/1226_2.png) [@Kominos](https://forums.spacerex.co/u/Kominos)\
**Post date:** [February 13, 2025, 12:01pm UTC](https://forums.spacerex.co/t/backup-your-icloud-photos-to-your-synology-nas-and-even-convert-to-jpg-automatically-with-icloudpd-via-docker/1083/12 "2025-02-13T12:01:25Z")

</div>

Hello, I have a problem when Im trying to initialise I get error Keyring file does not exist. Please try again.  
I dont want to authenticate with Keyring.

---

<div class="post-metadata">

**Author:** ![kimkon](https://forums.spacerex.co/letter_avatar_proxy/v4/letter/k/41988e/32.png) [@kimkon](https://forums.spacerex.co/u/kimkon)\
**Post date:** [August 29, 2026, 9:32am UTC](https://forums.spacerex.co/t/backup-your-icloud-photos-to-your-synology-nas-and-even-convert-to-jpg-automatically-with-icloudpd-via-docker/1083/13 "2026-08-29T09:32:11Z")

</div>

This is great info! Will have to look at it!
