How to Configure and Use Immich App for Photo Backup and OneDrive Sync

Immich is a powerful self-hosted photo backup and management app. In this post, I’ll share how I set up Immich to automatically back up original (RAW/HEIC) photos from iOS, then sync them to OneDrive using a simple scheduled task. I’ll also cover how to configure NGINX to handle high-quality photo uploads.
Enable Storage Management for Backup
Once you’ve deployed Immich (e.g., via Docker), you need to enable Storage Management so it can store photos from mobile devices:
- Go to Immich Admin at
http://<your-server>:2283
- Navigate to the
Storage Template
section. - Create or specify a storage path, for example:
/mnt/immich/library
- Set it as the default path for all users.
- Enable the Allow storage management option.
Once enabled, Immich will store original photos—including HEIC or RAW files—directly into this storage directory.
Sync Photos to OneDrive Using Scheduled Task
Instead of using rclone
, I use a Scheduled Task to sync the backed-up photos to a OneDrive folder. This allows long-term cloud storage and off-site backup without third-party tools.
For Windows Users
- Install the OneDrive app and configure a sync folder, e.g.:
C:\Users\<User>\OneDrive\ImmichBackup
Create a
.bat
file with the following content:robocopy "D:\Immich\library" "C:\Users\<User>\OneDrive\ImmichBackup" /E /XO
/E
: copies all subdirectories/XO
: skips older files
Set up a Scheduled Task:
- Trigger: At startup or daily
- Action: Run the
.bat
file - Optionally, set it to run with highest privileges
For Linux Users
If you're running Immich on a Linux server and using a OneDrive sync client (like onedrive
or onedrive-d
), you can create a simple cron job to copy files:
cp -ru /mnt/immich/library /path/to/OneDrive/ImmichBackup
Or use rsync
:
rsync -av --ignore-existing /mnt/immich/library/ /mnt/OneDrive/ImmichBackup/
Then schedule it via crontab
.
Configure NGINX for Large File Uploads (iOS)
If you're uploading high-resolution photos like HEIC or Apple ProRAW, they can be quite large. You might encounter issues like "413 Request Entity Too Large" or timeouts.
To fix this, update your NGINX configuration (typically used as a reverse proxy):
server {
client_max_body_size 512M;
proxy_read_timeout 600s;
proxy_connect_timeout 600s;
proxy_send_timeout 600s;
location / {
proxy_pass http://immich_server:3001;
...
}
}
After editing the config, reload NGINX:
sudo nginx -s reload
This ensures uploads of large files don’t fail due to time or size limits.
User Experience
- Immich iOS app supports automatic photo and video backup.
- Original quality is preserved (no compression).
- Photos are organized by albums and metadata.
- Web interface is clean and responsive.
Conclusion
Immich combined with OneDrive gives you:
- Full control over your photo data
- Backup of original high-quality photos (RAW, HEIC)
- A scalable, self-hosted alternative to Google Photos or iCloud
This setup is ideal for privacy-conscious users who want to keep their data under control while still having the benefits of cloud sync.
Subscribe to my newsletter
Read articles from Nam Ha Bach directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Nam Ha Bach
Nam Ha Bach
Simple