I
Immich•5mo ago
Jj_cale

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?
100 Replies
Immich
Immich•5mo ago
: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:
Jj_cale
Jj_caleOP•5mo ago
I have attached the files here for review here
Jj_cale
Jj_caleOP•5mo ago
Alex Tran
Alex Tran•5mo ago
I think you indentation might be incorrect Can you put your docker-compose.yml in a syntax check website?
Mraedis
Mraedis•5mo ago
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:
LIBRARY_LOCATION=/mnt/user/immich_photos/
DATA_LOCATION=/mnt/user/immich_cache/
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/
LIBRARY_LOCATION=/mnt/user/immich_photos/
DATA_LOCATION=/mnt/user/immich_cache/
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/
Compose:
- ${DATA_LOCATION}:/usr/src/app/upload
- ${UPLOAD_LOCATION}:/usr/src/app/upload/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
- ${DATA_LOCATION}:/usr/src/app/upload
- ${UPLOAD_LOCATION}:/usr/src/app/upload/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
Jj_cale
Jj_caleOP•5mo ago
So in env file. I should have upload mapped to immich cache. And in the yml file....
Mraedis
Mraedis•5mo ago
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
Jj_cale
Jj_caleOP•5mo ago
How do I go about keeping the ml cache on well . Cache... ? 😅
Mraedis
Mraedis•5mo ago
For ML, you'll want to onyl change the ML container like so;
volumes:
- ${ML_LOCATION}:/cache
volumes:
- ${ML_LOCATION}:/cache
And of course define the ML_LOCATION var in the env file
Jj_cale
Jj_caleOP•5mo ago
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.
Mraedis
Mraedis•5mo ago
Yes, I've renamed UPLOAD to DATA and added upload/upload as UPLOAD
Jj_cale
Jj_caleOP•5mo ago
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?
Mraedis
Mraedis•5mo ago
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
Jj_cale
Jj_caleOP•5mo ago
Okay so in env they point to exactly the same place.. that does not matter?
Mraedis
Mraedis•5mo ago
People often get confused (like you) and map the wrong upload one
Jj_cale
Jj_caleOP•5mo ago
Isn't that calling the same folder different names twice?
Mraedis
Mraedis•5mo ago
Ha you're right, I forgot to delete the /upload in my example 🫠 I've fixed it
Jj_cale
Jj_caleOP•5mo ago
Let me see
Mraedis
Mraedis•5mo ago
Buttt In hindsight, if you're all putting them on immich_cache, you only need to do it like this: Env:
LIBRARY_LOCATION=/mnt/user/immich_photos/
DATA_LOCATION=/mnt/user/immich_cache/
LIBRARY_LOCATION=/mnt/user/immich_photos/
DATA_LOCATION=/mnt/user/immich_cache/
Compose:
- ${DATA_LOCATION}:/usr/src/app/upload
- ${LIBRARY_LOCATION}:/usr/src/app/upload/library
- ${DATA_LOCATION}:/usr/src/app/upload
- ${LIBRARY_LOCATION}:/usr/src/app/upload/library
Because the top level folder will contain the other folders as well
Jj_cale
Jj_caleOP•5mo ago
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
Mraedis
Mraedis•5mo ago
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
Jj_cale
Jj_caleOP•5mo ago
Do I need to add these two lines to both server and ml part of the yml file?
Mraedis
Mraedis•5mo ago
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
Jj_cale
Jj_caleOP•5mo ago
I.e. does ml part needs to know where data and library are pointed at?
Mraedis
Mraedis•5mo ago
No
Jj_cale
Jj_caleOP•5mo ago
Okay
Mraedis
Mraedis•5mo ago
likewise immich_server does not need ML cache
Jj_cale
Jj_caleOP•5mo ago
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?
Mraedis
Mraedis•5mo ago
the uploads all go to /usr/src/app/upload/upload and then get processed into /usr/src/app/upload/library
Jj_cale
Jj_caleOP•5mo ago
Currently immich_photo is set to array only. Is it better to have it cache to array as well. To increase performance?
Mraedis
Mraedis•5mo ago
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
Jj_cale
Jj_caleOP•5mo ago
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?
Mraedis
Mraedis•5mo ago
Yes library in the container is still /usr/src/app/upload/library
Jj_cale
Jj_caleOP•5mo ago
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....
Mraedis
Mraedis•5mo ago
we don't compress originals
Jj_cale
Jj_caleOP•5mo ago
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.
Mraedis
Mraedis•5mo ago
Transcodes are purely for improved remote playback
Jj_cale
Jj_caleOP•5mo ago
Oh yeah. That's true..
Mraedis
Mraedis•5mo ago
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 😄
Jj_cale
Jj_caleOP•5mo ago
I will try to see how much space it saves/not save. I am 500gb only. Video sound alike a lot of space
Mraedis
Mraedis•5mo ago
Transcodes + thumbs take up about 15% space on top of the originals so 200GB data would be approximately 30GB of thumbs and transcodes
Jj_cale
Jj_caleOP•5mo ago
U duck about and u find out . I am all about learning by find out.
Mraedis
Mraedis•5mo ago
We heavily recommend having backups of your data of course 🙂 don't use immich as hte only source of truth
Jj_cale
Jj_caleOP•5mo ago
Oh yeah I have 3 back ups
Mraedis
Mraedis•5mo ago
Nice.
Jj_cale
Jj_caleOP•5mo ago
I am super paranoid about this
Mraedis
Mraedis•5mo ago
Sounds like you're the ideal candidate for this 😄
Jj_cale
Jj_caleOP•5mo ago
I have 1.5tb. Pics over the past 15 years. So thumbs plus video is like 200 gb
Mraedis
Mraedis•5mo ago
Ah my pics/videos over 15 years are 600GB 🙂 I've started shooting in higher definition because why not
Jj_cale
Jj_caleOP•5mo ago
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
Mraedis
Mraedis•5mo ago
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
Jj_cale
Jj_caleOP•5mo ago
I mean keep the transcoded video on HDD as well. But thumbs, data base on cache.
Mraedis
Mraedis•5mo ago
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
Jj_cale
Jj_caleOP•5mo ago
Should I modify the mapping u gave me earlier to reflect that? Not enough space in the cache for transcoded videos..
Mraedis
Mraedis•5mo ago
Sure, it's easily done
Jj_cale
Jj_caleOP•5mo ago
Sir show me the way
Mraedis
Mraedis•5mo ago
remember to copy/move all files with cp -a /old/folder /new/folder too
Jj_cale
Jj_caleOP•5mo ago
I am starting from scratch. So no files. Or do u mean the programe folder.
Mraedis
Mraedis•5mo ago
LIBRARY_LOCATION=/mnt/user/immich_photos/
VIDEO_LOCATION=/mnt/user/immich_photos/video/
DATA_LOCATION=/mnt/user/immich_cache/
LIBRARY_LOCATION=/mnt/user/immich_photos/
VIDEO_LOCATION=/mnt/user/immich_photos/video/
DATA_LOCATION=/mnt/user/immich_cache/
Compose:
- ${DATA_LOCATION}:/usr/src/app/upload
- ${VIDEO_LOCATION}:/usr/src/app/upload/encoded-video
- ${LIBRARY_LOCATION}:/usr/src/app/upload/library
- ${DATA_LOCATION}:/usr/src/app/upload
- ${VIDEO_LOCATION}:/usr/src/app/upload/encoded-video
- ${LIBRARY_LOCATION}:/usr/src/app/upload/library
Jj_cale
Jj_caleOP•5mo ago
Cannot I just delete the old one?
Mraedis
Mraedis•5mo ago
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 broken
Jj_cale
Jj_caleOP•5mo ago
Yeah. 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.
Mraedis
Mraedis•5mo ago
If you are uploading from CLI I highly recommend immich-go
Jj_cale
Jj_caleOP•5mo ago
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
Mraedis
Mraedis•5mo ago
filename is irrelevant for the checksum, it's on image data only
Jj_cale
Jj_caleOP•5mo ago
So I am planning to somehow manually remove duplicates from the old back ups
Mraedis
Mraedis•5mo ago
but also it does not compare external library content with internal
Jj_cale
Jj_caleOP•5mo ago
Well. I heard u cannot use the duplicate function between external library and uploaded files. Is that true?
Mraedis
Mraedis•5mo ago
I personally used https://github.com/qarmin/czkawka for deduplication
Jj_cale
Jj_caleOP•5mo ago
U read my mind Are u an immich dev?
Mraedis
Mraedis•5mo ago
No, I'm just a helper 😛
Jj_cale
Jj_caleOP•5mo ago
Why do u know everything?
Mraedis
Mraedis•5mo ago
No description
Jj_cale
Jj_caleOP•5mo ago
I have much to learn.
Mraedis
Mraedis•5mo ago
I'm also a senior linux system developer 😄 not for immich though
Jj_cale
Jj_caleOP•5mo ago
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.
Mraedis
Mraedis•5mo ago
That seems like like a question for the unraid people 😛
Jj_cale
Jj_caleOP•5mo ago
@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
Mraedis
Mraedis•5mo ago
how
Jj_cale
Jj_caleOP•5mo ago
i have tried both the local IP
Mraedis
Mraedis•5mo ago
thats not right
Jj_cale
Jj_caleOP•5mo ago
as well as the one via tailscale no?
Mraedis
Mraedis•5mo ago
8282:2883
Jj_cale
Jj_caleOP•5mo ago
what should it be?
Mraedis
Mraedis•5mo ago
HOST:CONTAINER
Jj_cale
Jj_caleOP•5mo ago
ha? where idd that 2883 come from? i see....
Mraedis
Mraedis•5mo ago
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
Jj_cale
Jj_caleOP•5mo ago
okay. chang incoming. FUCKING YES! it loaded!
Mraedis
Mraedis•5mo ago
This is true for any docker project btw
Jj_cale
Jj_caleOP•5mo ago
:peepoAwesome: okay so kinda internal external port
Mraedis
Mraedis•5mo ago
the right hand side is rigid (unless some kind of env var changes it too)
Jj_cale
Jj_caleOP•5mo ago
like a mini port forwarding but for a container and the host
Mraedis
Mraedis•5mo ago
not kinda, exactly that 😄
Jj_cale
Jj_caleOP•5mo ago
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
Mraedis
Mraedis•5mo ago
You can add it directly in the compose, env file is actually mostly for organisations sake
Jj_cale
Jj_caleOP•5mo ago
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?
Mraedis
Mraedis•5mo ago
so if you add OldPics=/mnt/user/pictures in the env then you do this in the compose:
- ${DATA_LOCATION}:/usr/src/app/upload
- ${VIDEO_LOCATION}:/usr/src/app/upload/encoded-video
- ${LIBRARY_LOCATION}:/usr/src/app/upload/library
- ${OldPics}:/mnt/oldpics
- ${DATA_LOCATION}:/usr/src/app/upload
- ${VIDEO_LOCATION}:/usr/src/app/upload/encoded-video
- ${LIBRARY_LOCATION}:/usr/src/app/upload/library
- ${OldPics}:/mnt/oldpics
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 UI
Jj_cale
Jj_caleOP•5mo ago
and i can give it a randome name this time
Mraedis
Mraedis•5mo ago
directly in the compose would be
- /mnt/user/pictures:/mnt/library/oldpics
- /mnt/user/pictures:/mnt/library/oldpics
Jj_cale
Jj_caleOP•5mo ago
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?

Did you find this page helpful?