Pulling my hair out with Immich Docker Compose setting in Unraid
I have spent at least 10 hours on this since yday and I just could not figure this one out.
What I am trying to do, is to put all the actual photo upload here at share Immich_photo, which sits on my array and I would like to the rest elements, thumbs, profiles, ML models and temp uploads to go to a share called immich_cache, which is a share that sits only on my cache.
I have tried to follow the guide here: https://github.com/immich-app/immich/discussions/2328#discussioncomment-5712579
Here is my .env file where I mapped everything:
DB_DATA_LOCATION=/mnt/user/appdata/postgres/
LIBRARY_LOCATION=/mnt/user/immich_photos/
UPLOAD_LOCATION=/mnt/user/immich_cache/upload/
THUMBS_LOCATION=/mnt/user/immich_cache/thumbs/
PROFILE_LOCATION=/mnt/user/immich_cache/profile/
VIDEO_LOCATION=/mnt/user/immich_cache/encoded-video/
ML_LOCATION=/mnt/user/immich_cache/ml/
and here are my compose file where I added the vol:
immich-server:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- ${LIBRARY_LOCATION}:/usr/src/app/upload/library
- ${THUMBS_LOCATION}:/usr/src/app/upload/thumbs
- ${PROFILE_LOCATION}:/usr/src/app/upload/profile
- ${VIDEO_LOCATION}:/usr/src/app/upload/encoded-video
- ${ML_LOCATION}:/usr/src/app/upload/ml
- /etc/localtime:/etc/localtime:ro
immich-machine-learning: - ${UPLOAD_LOCATION}:/usr/src/app/upload - ${LIBRARY_LOCATION}:/usr/src/app/upload/library - ${THUMBS_LOCATION}:/usr/src/app/upload/thumbs - ${PROFILE_LOCATION}:/usr/src/app/upload/profile - ${VIDEO_LOCATION}:/usr/src/app/upload/encoded-video - ${ML_LOCATION}:/usr/src/app/upload/ml - /etc/localtime:/etc/localtime:ro
Once I made the modification, I couldn't even get the immich-server docker to start (it just keeps on restarting). I am pretty sure something is wrong with the way I mapped the vol somehow but I am just not skilled enough with docker to figure it out. been going at it for hours and hours... any ideas?
immich-machine-learning: - ${UPLOAD_LOCATION}:/usr/src/app/upload - ${LIBRARY_LOCATION}:/usr/src/app/upload/library - ${THUMBS_LOCATION}:/usr/src/app/upload/thumbs - ${PROFILE_LOCATION}:/usr/src/app/upload/profile - ${VIDEO_LOCATION}:/usr/src/app/upload/encoded-video - ${ML_LOCATION}:/usr/src/app/upload/ml - /etc/localtime:/etc/localtime:ro
Once I made the modification, I couldn't even get the immich-server docker to start (it just keeps on restarting). I am pretty sure something is wrong with the way I mapped the vol somehow but I am just not skilled enough with docker to figure it out. been going at it for hours and hours... any ideas?
100 Replies
:wave: Hey @Jj_cale,
Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:.
References
- Container Logs:
docker compose logs
docs
- Container Status: docker ps -a
docs
- Reverse Proxy: https://immich.app/docs/administration/reverse-proxy
- Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA
Checklist
I have...
1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time).
2. :ballot_box_with_check: read applicable release notes.
3. :ballot_box_with_check: reviewed the FAQs for known issues.
4. :ballot_box_with_check: reviewed Github for known issues.
5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy).
6. :ballot_box_with_check: uploaded the relevant information (see below).
7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable
(an item can be marked as "complete" by reacting with the appropriate number)
Information
In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider:
- Your docker-compose.yml and .env files.
- Logs from all the containers and their status (see above).
- All the troubleshooting steps you've tried so far.
- Any recent changes you've made to Immich or your system.
- Details about your system (both software/OS and hardware).
- Details about your storage (filesystems, type of disks, output of commands like fdisk -l
and df -h
).
- The version of the Immich server, mobile app, and other relevant pieces.
- Any other information that you think might be relevant.
Please paste files and logs with proper code formatting, and especially avoid blurry screenshots.
Without the right information we can't work out what the problem is. Help us help you ;)
If this ticket can be closed you can use the /close
command, and re-open it later if needed.
Successfully submitted, a tag has been added to inform contributors. :white_check_mark:I have attached the files here for review here
I think you indentation might be incorrect
Can you put your docker-compose.yml in a syntax check website?
You've fallen for the classic trap @Jj_cale
UPLOAD_LOCATION is not immich_cache/upload but immich_cache
it corresponds to /usr/src/app/upload
You want immich_cache/upload linked to /usr/src/app/upload/upload
For the immich_server container you could use this
Env:
Compose:
So in env file. I should have upload mapped to immich cache. And in the yml file....
I've renamed the original UPLOAD to DATA to prevent confusion here 🙂
DB_DATA and ML are not in the immich_server container so I've left this out for this example
How do I go about keeping the ml cache on well . Cache... ? 😅
For ML, you'll want to onyl change the ML container like so;
And of course define the ML_LOCATION var in the env file
Okay. So basically. The only change here is that we have upload/upload. Like in the impose file. Otherwise no changes to the env file as per your example.
Yes, I've renamed UPLOAD to DATA and added upload/upload as UPLOAD
I am sorry. Could u tell me why u added the data one. So now there is both data and upload. Why there are two vol mapped now?
Because they are not the same thing
Original env: UPLOAD_LOCATION = /usr/src/app/upload
But this folder actually contains another folder called upload, so /usr/src/app/upload/upload
Okay so in env they point to exactly the same place.. that does not matter?
People often get confused (like you) and map the wrong upload one
Isn't that calling the same folder different names twice?
Ha you're right, I forgot to delete the /upload in my example ðŸ«
I've fixed it
Let me see
Buttt
In hindsight, if you're all putting them on immich_cache, you only need to do it like this:
Env:
Compose:
Because the top level folder will contain the other folders as well
In the /app/upload in the yml file. That upload is just a name right? I could set everything to to /app/Applebees for all I want instead of calling that folder upload. Or would that break everything again
in which case you can keep the upload name if you want because there is no confusion possible
No the /usr/src/app/upload is needed
Do I need to add these two lines to both server and ml part of the yml file?
on the HOST side you can name it whatever you want, but in the container it needs to be /usr/src/app/upload etc
No, only immich_server
I.e. does ml part needs to know where data and library are pointed at?
No
Okay
likewise immich_server does not need ML cache
One last thing..
And thank u soivh for helping me
Sorry for the noob questions. I am new to linux
The way I set it up. When I upload pics. Where does it go initially. Does it go to array directly?
the uploads all go to /usr/src/app/upload/upload and then get processed into /usr/src/app/upload/library
Currently immich_photo is set to array only. Is it better to have it cache to array as well. To increase performance?
so ideally /usr/src/app/upload/upload is empty
We recommend to have the thumbs, encoded-video and db_data folders on an SSD
if you really are short on space, the db_data one is the most important
don't ever put db_data on a network drive
In its current definition. Did library becomes of a subfolder of upload? U just map them to completely different places on the server. But logically. One is a sub folder or another?
Yes library in the container is still /usr/src/app/upload/library
I only back up 2 phones and have set immich to never transcode a video (I don't wanna compress anything ever). I'd rather have slow than compression in video....
we don't compress originals
Next time. Where do I go in a docker setting to see all these things. I.e. the docker needs a folder called upload and another called library and it has to be called these things etc.
Transcodes are purely for improved remote playback
Oh yeah. That's true..
You ask the people that make the app 😛 but you could also do
docker exec -it immich_server /bin/bash
and explore. If you're new to linux I would not recommend doing this in any data you consider critical though 😄I will try to see how much space it saves/not save. I am 500gb only. Video sound alike a lot of space
Transcodes + thumbs take up about 15% space on top of the originals
so 200GB data would be approximately 30GB of thumbs and transcodes
U duck about and u find out . I am all about learning by find out.
We heavily recommend having backups of your data of course 🙂
don't use immich as hte only source of truth
Oh yeah
I have 3 back ups
Nice.
I am super paranoid about this
Sounds like you're the ideal candidate for this 😄
I have 1.5tb. Pics over the past 15 years. So thumbs plus video is like 200 gb
Ah my pics/videos over 15 years are 600GB 🙂
I've started shooting in higher definition because why not
Okay my cache is only 500gb and I need it to download stuff for Plex. So I think I will keep video on HDD then... Oh crap . Do I need to add more lines to the mapping now
I have been a part time photographer since college. The big files are all raw stuff. Phone pics are only like 200 gb out of the 1.5tb
So just to be clear, immich's core principle is to never touch the original
if you edit time/date/location/whatever in the UI it will create an XMP sidecar with the edits
I mean keep the transcoded video on HDD as well. But thumbs, data base on cache.
In the future there might be a small editor like rotate crop etc, but again that will be 💯 % in the XMP file, not the original
Should I modify the mapping u gave me earlier to reflect that? Not enough space in the cache for transcoded videos..
Sure, it's easily done
Sir show me the way
remember to copy/move all files with
cp -a /old/folder /new/folder
tooI am starting from scratch.
So no files.
Or do u mean the programe folder.
Compose:
Cannot I just delete the old one?
Then don't worry about it
after initial startup immich creates a hidden
.immich
file
if it does not find this file after a restart then it will consider the location brokenYeah. That was giving me trouble earlier
I changed something. And log says it can't find that immich file in the video folder. I manually copied it there. Did not help.
If you are uploading from CLI I highly recommend immich-go
I am keeping the 1.5tb as external. As I have a folder structure I need to maintain
Issue here is that all the uploads will be from my and my so's phone.
Part of what's in the phone are already backed up via another system, which will be external now.
File name have been changed previously in backup so checksum won't be the same e
filename is irrelevant for the checksum, it's on image data only
So I am planning to somehow manually remove duplicates from the old back ups
but also it does not compare external library content with internal
Well. I heard u cannot use the duplicate function between external library and uploaded files. Is that true?
U read my mind
Are u an immich dev?
No, I'm just a helper 😛
Why do u know everything?

I have much to learn.
I'm also a senior linux system developer 😄
not for immich though
That explains.
That tool u linked me.
For dups
It does not support unraid by the look of it?
Anyhow. Thank u for ur help. Much appreciated. I will go try to implement ur guidance. Good luck to me and I shall report back how it goes.
That seems like like a question for the unraid people 😛
@Mraedis so i am back on implmenting everything you have told me.
so far. its gone better. everything seems to be up and running when i run docker-compose ps.
however. I cannot reach the web UI.
i have changed the port to 8282
so in the YML file it says
ports:
- '8282:8282' now
how
i have tried both the local IP
thats not right
as well as the one via tailscale
no?
8282:2883
what should it be?
HOST:CONTAINER
ha? where idd that 2883 come from?
i see....
the container will always need 2883
It uses port 8282 on your host for the container's 2883 port
If you have, for instance, multiple immich instances for whatever reason, you could use 8282:2883 for instance 1, and 8383:2883 for instance 2 etc
okay. chang incoming.
FUCKING YES!
it loaded!
This is true for any docker project btw
:peepoAwesome:
okay so kinda internal external port
the right hand side is rigid (unless some kind of env var changes it too)
like a mini port forwarding
but for a container and the host
not kinda, exactly that 😄
oh okay okay. I have done plenty that on my router. now i actually see how it is applied here
amazing.
and to add external lib. i need to add something like this into the .env, right?
OldPics=/mnt/user/pictures
pictures are a share I have with all the old pics i am gonna just use as external libraries
You can add it directly in the compose, env file is actually mostly for organisations sake
so this is basically the same things as adding a path in the docker UI, which i have to do in .env file now since it is docker-compose?
add it in compose..
but this is a new share that has not been previously defined anywhere in anything. so shouldnt I introduce the location in the .env file?
so if you add
OldPics=/mnt/user/pictures
in the env then you do this in the compose:
The name /mnt/oldpics
is arbitrary but it's best to keep the names relevant and organized. Choose anything after /mnt/
because immich does not make anything itself there.
You would then add /mnt/oldpics
in the UIand i can give it a randome name this time
directly in the compose would be
it can be called anything
- /mnt/user/pictures:/mnt/library/oldpics so it needs to be under library
as oppose to - /mnt/user/pictures:/mnt/oldpics
Or are these two basically the same thing?