Skip to content

Immich: make UPLOAD_LOCATION and DB_DATA_LOCATION take effect - #355

Merged
crypt0rr merged 1 commit into
mainfrom
immich-upload-location
Oct 2, 2026
Merged

crypt0rr merged 1 commit into
mainfrom
immich-upload-location

Conversation

@jackspiering

Copy link
Copy Markdown
Collaborator

Closes #310.

What changed

  • compose.yaml: the media and database mounts now use ${UPLOAD_LOCATION} and ${DB_DATA_LOCATION}, as the upstream Immich compose file does.
  • .env: the defaults are now ./${SERVICE}-data/upload and ./${SERVICE}-data/database. These are the folders the stack used so far, so a default installation keeps its data in place.
  • README.md: two new usage notes. One explains the storage variables, the other tells existing users what to check before they restart.

Why

Issue #310 reports that changing UPLOAD_LOCATION in .env has no effect. The compose file mounted fixed ./${SERVICE}-data/... paths and never read either variable, while the comment above each mount said to change the location in .env.

DB_DATA_LOCATION had the same problem, so this fixes both.

Upgrade note

The old .env defaults were ./library and ./postgres. They were ignored before and take effect now. A git pull merges the new defaults in. Anyone who updates compose.yaml but keeps an older .env must replace those two values first. Otherwise Immich starts with an empty library and a new database. The existing files stay untouched in ./immich-data. The README covers this.

Testing

Tested on Docker 29.8.2 with a test node in a Tailnet, SERVICE=immich-test-310:

  • Default values: all five containers healthy, media and database folders created under ./immich-test-310-data/, and https://<node>.<tailnet>.ts.net/api/server/ping answered {"res":"pong"}.
  • Both variables set to absolute paths in another folder: media and database folders created there, the default data folder held only model-cache, and the ping answered pong.
  • docker compose config resolves the default mounts to the same host paths as main.
  • docker compose config --quiet, rumdl check, and git diff --check pass.

Not tested: updating an existing installation that already holds photos. Both runs started from an empty stack.

The compose file mounted fixed ./${SERVICE}-data paths, so the two
storage variables in .env were never read. Changing UPLOAD_LOCATION had
no effect on where Immich stored media.

- compose.yaml: mount ${UPLOAD_LOCATION} and ${DB_DATA_LOCATION}, as the
  upstream compose file does.
- .env: set the defaults to the folders the stack used so far, so a
  default installation keeps its data in place.
- README: document both variables and tell existing users to replace
  the old ./library and ./postgres values before restarting.
@jackspiering
jackspiering requested a review from crypt0rr October 2, 2026 19:56
@crypt0rr
crypt0rr merged commit 0c6fa15 into main Oct 2, 2026
1 check passed
@crypt0rr
crypt0rr deleted the immich-upload-location branch October 2, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐞 Bug: Immich - Changing UPLOAD_LOCATION in .env has no effect on where files are stored

2 participants