I
Immich5mo ago
Bright

Changing "UPLOAD_LOCATION" cause immich to be unavailable

I'm trying to change my upload location to a known good directory on a seperate drive. I went through the hassel of getting the drive setup and availible. The file path if good. But when I switch the .env file to change the upload location to the other path, and re-deploy my container, I loose access to my immich. But if I go in and switch it back to library and deploy again it works again. How do I go about switching the picture upload location to a directory on a separate disk without breaking my immich? Default .env:
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-va>
# The location where your uploaded files are stored
UPLOAD_LOCATION=./library
# The location where your database files are stored
DB_DATA_LOCATION=./postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wiki># TZ=Etc/UTC

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-va>
# The location where your uploaded files are stored
UPLOAD_LOCATION=./library
# The location where your database files are stored
DB_DATA_LOCATION=./postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wiki># TZ=Etc/UTC

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
I am changing the file path to /home/void/auxdrive/immich -------------------------------------------------------------- Running immich with docker on Ubuntu server 24.04.1. Immich is setup on the 128gb booth drive currently. Trying to point the uploads to my 2TB HDD for mass storage.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 119.2G 0 disk
├─sda1 8:1 0 1G 0 part /boot/efi
└─sda2 8:2 0 118.2G 0 part /
sdb 8:16 0 3.6T 0 disk
└─sdb1 8:17 0 2T 0 part /home/void/auxdrive
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 119.2G 0 disk
├─sda1 8:1 0 1G 0 part /boot/efi
└─sda2 8:2 0 118.2G 0 part /
sdb 8:16 0 3.6T 0 disk
└─sdb1 8:17 0 2T 0 part /home/void/auxdrive
26 Replies
Immich
Immich5mo ago
:wave: Hey @Bright, 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:
Zeus
Zeus5mo ago
You need to stop immich, then move the folder to the new location, when changing the variable Otherwise immich is missing data
Bright
BrightOP5mo ago
So I installed a GUI just so I could try to get this working. I moved the files via the GUI, and I changed the .env file to match the new file path, but it still leaves immich unavailable. I reverted everything back, and did an immich reset and now its unavailbie. I think I broke my immich.
icedragon2002002
docker logs would be helpful in this situation so we could know what immich maybe complaining about or rather logs from immich would be helpful
Bright
BrightOP5mo ago
Ok. I cleared out my entire immich instances and I'm rebuilding it. Before I spin up the docker container, how do I need to change the .env to put all my uploads into a different location on a different drive? I copied that from the other sub. So I just wiped my old instance and setup a new container. Before I up the container I want to get it pointed at the right location to start with.
icedragon2002002
well based off of what you posted above
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-va>
# The location where your uploaded files are stored
UPLOAD_LOCATION=/home/void/auxdrive/immich
# The location where your database files are stored
DB_DATA_LOCATION=./postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wiki># TZ=Etc/UTC

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-va>
# The location where your uploaded files are stored
UPLOAD_LOCATION=/home/void/auxdrive/immich
# The location where your database files are stored
DB_DATA_LOCATION=./postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wiki># TZ=Etc/UTC

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
Bright
BrightOP5mo ago
I'm scouring their site, reading about all the environment variables, but its not anything that I can get info from. I did it that way and it broke immich. lol
icedragon2002002
well there is another problem with the location of your db as well so ./ means store all my data in the folder that the compose was run from so you may want to specify your db location as well
Bright
BrightOP5mo ago
I wonder if its something I have to do during initial install so that it sets it up automatically. I'm going to just try that .env file right there and spin it up and see what happens. Worst case, I just delete it again...
icedragon2002002
thats the beauty of docker
Bright
BrightOP5mo ago
So I just setup the container on the 2tb drive and ran everything default minus the password and now it works and it stores everything on the bigger drive.. lol. it might make the container run a little slower being on an HDD rather than an nvme, but oh well. I just need it to actually hold my stuff.. lol
icedragon2002002
you could use custom locations https://immich.app/docs/guides/custom-locations/ split your db, thumb, and encoded videos on the ssd and your upload to the spindle drive this is the solution I ended up doing btw
Bright
BrightOP5mo ago
AHA! that's the issue.... it doesn't tell you that you need to change the docker-compose.yaml. In the file it specifically says not to change it in that file, and to change it in the .env file only.....
icedragon2002002
unless you are using custom locations remember you need to add the handles for the new custom config in the compose and the .env
Bright
BrightOP5mo ago
that makes sense.. I knew it did the whole time.. but the compose file says not to touch it..
icedragon2002002
here is my compose. dont use it as there are environment variables that may not work for your config
#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich
services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
extends:
file: hwaccel.transcoding.yml
service: vaapi # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
volumes:
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- ${THUMB_LOCATION}:/usr/src/app/upload/thumbs
- ${ENCODED_VIDEO_LOCATION}:/usr/src/app/upload/encoded-video
- ${PROFILE_LOCATION}:/usr/src/app/upload/profile
- ${BACKUP_LOCATION}:/usr/src/app/upload/backups
- /etc/localtime:/etc/localtime:ro
env_file:
- .env
ports:
- 2283
depends_on:
- redis
- database
restart: always
healthcheck:
disable: false
immich-machine-learning:
container_name: immich_machine_learning
# For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
# Example tag: ${IMMICH_VERSION:-release}-cuda
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino
extends:
# uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
file: hwaccel.ml.yml
service: openvino # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
volumes:
- model-cache:/cache
env_file:
- .env
restart: always
healthcheck:
disable: false
redis:
container_name: immich_redis
image: docker.io/redis:6.2-alpine@sha256:eaba718fecd1196d88533de7ba49bf903ad33664a92debb24660a922ecd9cac8
healthcheck:
test: redis-cli ping || exit 1
restart: always
database:
container_name: immich_postgres
image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: --data-checksums
volumes:
# Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
healthcheck:
test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' ||
exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}'
--username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT
COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo
"checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
interval: 5m
start_interval: 30s
start_period: 5m
command: postgres -c shared_preload_libraries=vectors.so -c
'search_path="$$user", public, vectors' -c logging_collector=on -c
max_wal_size=2GB -c shared_buffers=512MB -c wal_compression=on
restart: always
volumes:
model-cache: null
networks:
default:
name: ARRRR
external: true
#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich
services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
extends:
file: hwaccel.transcoding.yml
service: vaapi # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
volumes:
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- ${THUMB_LOCATION}:/usr/src/app/upload/thumbs
- ${ENCODED_VIDEO_LOCATION}:/usr/src/app/upload/encoded-video
- ${PROFILE_LOCATION}:/usr/src/app/upload/profile
- ${BACKUP_LOCATION}:/usr/src/app/upload/backups
- /etc/localtime:/etc/localtime:ro
env_file:
- .env
ports:
- 2283
depends_on:
- redis
- database
restart: always
healthcheck:
disable: false
immich-machine-learning:
container_name: immich_machine_learning
# For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
# Example tag: ${IMMICH_VERSION:-release}-cuda
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino
extends:
# uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
file: hwaccel.ml.yml
service: openvino # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
volumes:
- model-cache:/cache
env_file:
- .env
restart: always
healthcheck:
disable: false
redis:
container_name: immich_redis
image: docker.io/redis:6.2-alpine@sha256:eaba718fecd1196d88533de7ba49bf903ad33664a92debb24660a922ecd9cac8
healthcheck:
test: redis-cli ping || exit 1
restart: always
database:
container_name: immich_postgres
image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: --data-checksums
volumes:
# Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
healthcheck:
test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' ||
exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}'
--username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT
COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo
"checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
interval: 5m
start_interval: 30s
start_period: 5m
command: postgres -c shared_preload_libraries=vectors.so -c
'search_path="$$user", public, vectors' -c logging_collector=on -c
max_wal_size=2GB -c shared_buffers=512MB -c wal_compression=on
restart: always
volumes:
model-cache: null
networks:
default:
name: ARRRR
external: true
and my env
Bright
BrightOP5mo ago
volumes:
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- /etc/localtime:/etc/localtime:ro
volumes:
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- /etc/localtime:/etc/localtime:ro
icedragon2002002
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/home/void/data/immich/
THUMB_LOCATION=/home/void/immich/thumbs
ENCODED_VIDEO_LOCATION=/home/void/immich/encoded-video
PROFILE_LOCATION=/home/void/data/immich/profile
BACKUP_LOCATION=/home/void/data/immich/backups
# The location where your database files are stored
DB_DATA_LOCATION=/home/void/immich/database

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
TZ=America/Chicago

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=v1.123.0

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=postgres

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=void
DB_DATABASE_NAME=void
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/home/void/data/immich/
THUMB_LOCATION=/home/void/immich/thumbs
ENCODED_VIDEO_LOCATION=/home/void/immich/encoded-video
PROFILE_LOCATION=/home/void/data/immich/profile
BACKUP_LOCATION=/home/void/data/immich/backups
# The location where your database files are stored
DB_DATA_LOCATION=/home/void/immich/database

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
TZ=America/Chicago

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=v1.123.0

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=postgres

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=void
DB_DATABASE_NAME=void
they do that prob in part because the custom locations thing is sort of recent and the other reason I can think of is to keep the newbs at bay
Bright
BrightOP5mo ago
yup.. and it worked.. kinda.. lol it just sent me in circles....
icedragon2002002
gotta know what you are doing when it comes to docker
Bright
BrightOP5mo ago
they need to refer to the page for info on customer locations lol.
icedragon2002002
yet there are a lot of newbies that are kinda just winging it not taking any security into account either
Bright
BrightOP5mo ago
oh for sure...
icedragon2002002
but now youve got my compose and .env as sort of a reference so you should be good to go
Bright
BrightOP5mo ago
yup. I'll take another crack at it. lol whew. I got it working! Running it from my sata drive, uploading photos/videos to the HDD, and thumbs on the NVME. I made all the directories and it seems to be uploading and working just fine.
icedragon2002002
You should notice a performance boost in comparison to running immich just on a spindle disk

Did you find this page helpful?