Configuring UPLOAD_LOCATION in immich.json
Hi,
before I put in a feature request Id like to understand why the UPLOAD_LOCATION path (the main immich library) can not be configured in the immich.json config file.
Use case: the Cloudron (https://www.cloudron.io/) app manager does not use docker compose. So the UPLOAD_LOCATION env var is not usable in their context.
Cloudron
Cloudron - Complete solution for self-hosting
Cloudron the best platform for self-hosting web apps.
35 Replies
:wave: Hey @perelin,
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. :blue_square: verified I'm on the latest release(note that mobile app releases may take some time).
2. :blue_square: read applicable release notes.
3. :blue_square: reviewed the FAQs for known issues.
4. :blue_square: reviewed Github for known issues.
5. :blue_square: tried accessing Immich via local ip (without a custom reverse proxy).
6. :blue_square: uploaded the relevant information (see below).
7. :blue_square: 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.Because those are docker variables, not immich config variables
Yes, I know. The question is: why are they?
There is no way for a container to edit itself from within, we cannot put that in the immich config json
config.json has other config variables, like the URL of the machine learning container.
Which is not a docker variable, so I fail to see your point
Are you looking for
IMMICH_MEDIA_LOCATION
? https://immich.app/docs/install/environment-variables#general@Mraedis It very well could be a docker compose variable as well. Its just config for the Immich app after all, as ist the location of the upload path. My question is: is there an inherent reason why the upload path is only exposed as a mounting point in the docker compose file and not in the config.json.
@Daniel Thanks, from my understanding the UPLOAD_LOCATION is the mounting point of the upload folder path.
I feel like you're fundamentally misunderstanding containers
Would be fun after being a software developer for 20+ years.
But ok. So, no real answer why some of the app config is injected through env vars on docker run time, and some are read from the config json.
thought it might be some inherent architecture thing
The real answer is: upload_location needs to be mounted to... anything...
which you have to do at container creation
Immich has no way of configuring a docker mount
which you cannot do at runtime
@Daniel so, when a docker container is run, it executes some an entry point command. The Immich container starts the Immich application. Immich needs to know where to upload files, and eg where to send queries for machine learning. The upload location is set to
/usr/src/app/upload
which is mounted to whatever the docker-compose files sets as env var there. So why is the upload path hard coded to /usr/src/app/upload
when it could also be read from the json config file? That is essentially my question.If you want to change
/usr/src/app/upload
you can use this ^
We maybe could do that at runtime, but it's a lot simpler only having that on startup with an env variable for ImmichI totally see that. The issue only comes for app managers like Cloudron that do not use Docker Compose.
Surely cloudron still uses docker though and doesn't run it baremetal?
Yes, docker. But in their particular case the apps gets installed, and only after install it allows mounting of external storage to the container. Also the user has no way of actually injecting
docker run
parameters, BUT has access to the container file system to manipulate config files (which tbh most other media managers use).That sounds like a fundamental flaw of that software then
It should absolutely allow you to at least (1) set ENV variables and (2) set volume mounts for containers
If neither works I'd say just don't use cloudron, as it obviously sucks
This isn't just an issue with Immich either, most containers are designed with those assumptions, and it's arguably best practice too
So far Immich is the only media manager that does not work nicely with Cloudron in that regard (external storage).
(1) ENV vars can be set
(2) Volume mounts can be set
Both AFTER installation.
I wonder why the development team has to support some obscure implementation, when there's already a standard way of doing it using what containers already offer?
But in the spirit of "be nice": I wanted to understand how Immich thinks about these things. I think I understand it a bit better now. Thanks.
Oh sorry, I didn't mean to not be nice. I just tried to answer your questions and generally we see such products every other day, and they usually just suck and make matters worse
YMMV, I enjoy Cloduron for finally fully managing all aspects of self hosting, incl full server management, auto updates, backups, etc. But I get where you are coming from.
You don't happen to know what they mean with that?

No, Im not affiliated in any way with the devs.
So, if I set IMMICH_MEDIA_LOCATION and restart the container... what happens then?
Will the Immich DB pick up the new location? How does that work?
/usr/src/app/upload
will then be IMMICH_MEDIA_LOCATION
inside the container
If you already have assets in your database, no
This is something you need to set when getting started with ImmichSo, needs to be set BEFORE first initialisation, or just before first media upload?
Before media upload
Ah! Now that could be a way. UI will try that. Thanks for the help!
But also: no way to change the upload path later on? eg migrate to another storage?
Note though that if anything breaks or something, we won't be able to give support for such third party solution
Ofc you can
Absolutley understood.
You just need to move your files
Found it: https://immich.app/docs/developer/database-migrations
So, move files, set new IMMICH_MEDIA_LOCATION, restart container, right?
ah wait, no, that is the dev migration doc 🙂 sory
Ok, I think I will try that now. Thanks again!
This thread has been closed. To re-open, use the button below.