DB_HOSTNAME required if running with something other than Docker? #5783

Closed
opened 2026-02-05 11:44:35 +03:00 by OVERLORD · 7 comments
Owner

Originally created by @dpkg-i-foo-deb on GitHub (Apr 6, 2025).

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

I tried to host Immich using podman Quadlets and I followed the official docker-compose deployment guide, I wrote Quadlet files the same as shown on the docker-compose.yml file... I spent several hours getting this error on immich_server

Initializing Immich v1.131.3 Detected CPU Cores: 12 Starting api worker Starting microservices worker [Nest] 2 - 04/05/2025, 10:27:52 PM LOG [Microservices:EventRepository] Initialized websocket server microservices worker error: TypeError: Cannot read properties of undefined (reading 'replace'), stack: TypeError: Cannot read properties of undefined (reading 'replace') at queryError (/usr/src/app/node_modules/postgres/cjs/src/connection.js:389:48) at errored (/usr/src/app/node_modules/postgres/cjs/src/connection.js:384:17) at Socket.error (/usr/src/app/node_modules/postgres/cjs/src/connection.js:376:5) at Socket.emit (node:events:518:28) at emitErrorNT (node:internal/streams/destroy:170:8) at emitErrorCloseNT (node:internal/streams/destroy:129:3) at process.processTicksAndRejections (node:internal/process/task_queues:90:21) microservices worker exited with code 1 Killing api process

I thought I did something silly, but the immich network worked fine and I could telnet from the database from the immich_server container... I checked the environment variables you could set and I noticed a variable called DB_HOSTNAME which defaults to 'database' which is not the hostname set on the docker-compose.yml file

After I added the DB_HOSTNAME and set it to immich_postgres the immich_server container worked correctly

So I wonder... Is this environment variable missing from the .env file and the docker-compose.yml file? I don't have a docker host yet I can provide my Ansible tasks and you can see they're practically the same

---
- name: Create Immich Server Quadlet file
  become: true
  become_user: '{{ immich_user }}'
  notify: Restart Immich
  containers.podman.podman_container:
    name: '{{ immich_server_container }}'
    image: ghcr.io/immich-app/immich-server:release
    state: quadlet
    quadlet_filename: '{{ immich_server_container }}'
    ports:
      - '{{ immich_http_port | default(2283) }}:2283'
    network: '{{ immich_network }}'
    volumes:
      - '{{ immich_library_dir }}:/usr/src/app/upload'
      - /etc/localtime:/etc/localtime:ro
    env:
      PUID: '1000'
      PGID: '1000'
      TZ: '{{ tz }}'
      # immich_server won't start unless I add this variable
      DB_HOSTNAME: '{{ immich_db_host }}'
      DB_DATABASE_NAME: '{{ immich_db_name }}'
      DB_USERNAME: '{{ immich_db_user }}'
      DB_PASSWORD: '{{ immich_db_pass }}'
    quadlet_options:
      - 'AutoUpdate=registry'
      - 'Pull=newer'
      - |
        [Service]
        Restart=always
        RestartSec=10
      - |
        [Install]
        WantedBy=default.target multi-user.target

- name: Create Immich Machine Learning Quadlet file
  become: true
  become_user: '{{ immich_user }}'
  notify: Restart Immich Machine Learning
  containers.podman.podman_container:
    name: '{{ immich_machine_learning_container }}'
    image: ghcr.io/immich-app/immich-machine-learning:release
    state: quadlet
    quadlet_filename: '{{ immich_machine_learning_container }}'
    network: '{{ immich_network }}'
    volumes:
      - '{{ immich_machine_learning_dir }}:/usr/src/app/upload'
    env:
      PUID: '1000'
      PGID: '1000'
      TZ: '{{ tz }}'
    quadlet_options:
      - 'AutoUpdate=registry'
      - 'Pull=newer'
      - |
        [Service]
        Restart=always
        RestartSec=10
      - |
        [Install]
        WantedBy=default.target multi-user.target

- name: Create Redis Quadlet file
  become: true
  become_user: '{{ immich_user }}'
  notify: Restart Immich Redis
  containers.podman.podman_container:
    name: '{{ immich_redis_container }}'
    image: docker.io/redis:6.2-alpine@sha256:148bb5411c184abd288d9aaed139c98123eeb8824c5d3fce03cf721db58066d8
    state: quadlet
    quadlet_filename: '{{ immich_redis_container }}'
    network: '{{ immich_network }}'
    env:
      PUID: '1000'
      PGID: '1000'
      TZ: '{{ tz }}'
    quadlet_options:
      - 'AutoUpdate=registry'
      - 'Pull=newer'
      - |
        [Service]
        Restart=always
        RestartSec=10
      - |
        [Install]
        WantedBy=default.target multi-user.target

And here's how I deploy Postgres

---
- name: Set postgres_volumes fact
  ansible.builtin.set_fact:
    postgres_volumes:
      - '{{ (postgres_data_dir is defined | ternary(postgres_data_dir, postgres_data_vol)) }}:/var/lib/postgresql/data'

- name: Append postgres_init_script volume if defined
  ansible.builtin.set_fact:
    postgres_volumes: "{{ postgres_volumes + [postgres_init_script + ':/docker-entrypoint-initdb.d/initdb.sql:z'] }}"
  when: postgres_init_script is defined

- name: Create Postgres Quadlet file
  become: true
  become_user: '{{ postgres_podman_user }}'
  notify: Restart Postgres
  containers.podman.podman_container:
    name: '{{ postgres_container }}'
    image: '{{ postgres_image | default("docker.io/postgres:latest") }}'
    userns: "{{ 'auto' if postgres_data_dir is defined or postgres_init_script is defined else '' }}"
    network: '{{ postgres_network }}'
    state: quadlet
    quadlet_filename: '{{ postgres_container }}'
    ports:
      - '5432:5432'
    volumes: '{{ postgres_volumes }}'
    command: '{{ postgres_command | default(omit) }}'
    env:
      PUID: '1000'
      PGID: '1000'
      TZ: '{{ tz }}'
      POSTGRES_DB: '{{ postgres_db }}'
      POSTGRES_USER: '{{ postgres_user }}'
      POSTGRES_PASSWORD: '{{ postgres_pass }}'
      POSTGRES_INITDB_ARGS: '{{ postgres_initdb_args | default(omit) }}'
    quadlet_options:
      - 'AutoUpdate=registry'
      - 'Pull=newer'
      - |
        [Service]
        Restart=always
        RestartSec=10
      - |
        [Install]
        WantedBy=default.target multi-user.target

They're all in the same network and immich_server will only start when I set DB_HOSTNAME to immich_server which

The OS that Immich Server is running on

Debian 13

Version of Immich Server

release

Version of Immich Mobile App

N/A

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

#
# WARNING: To install Immich, follow our guide: https://immich.app/docs/install/docker-compose
#
# 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: cpu # 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
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - '2283: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, rocm, openvino, rknn] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] 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:148bb5411c184abd288d9aaed139c98123eeb8824c5d3fce03cf721db58066d8
    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:739cdd626151ff1f796dc95a6591b55a714f341c737e27f045019ceabf8e8c52
    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="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" || exit 1; Chksum="$$(psql --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --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:

Your .env content

# 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=./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.wikipedia.org/wiki/List_of_tz_database_time_zones#List
# 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=postgres

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

  1. Download docker-compose.yml and .env file from https://immich.app/docs/install/docker-compose
  2. Adapt it to run with Podman
  3. immich_server keeps restarting because it won't find Postgres, which I think it happens because it is looking for 'database' but postgres host was set to immich_postgres

Relevant log output


Additional information

No response

Originally created by @dpkg-i-foo-deb on GitHub (Apr 6, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug I tried to host Immich using podman Quadlets and I followed the official docker-compose deployment guide, I wrote Quadlet files the same as shown on the docker-compose.yml file... I spent several hours getting this error on immich_server `Initializing Immich v1.131.3 Detected CPU Cores: 12 Starting api worker Starting microservices worker [Nest] 2 - 04/05/2025, 10:27:52 PM LOG [Microservices:EventRepository] Initialized websocket server microservices worker error: TypeError: Cannot read properties of undefined (reading 'replace'), stack: TypeError: Cannot read properties of undefined (reading 'replace') at queryError (/usr/src/app/node_modules/postgres/cjs/src/connection.js:389:48) at errored (/usr/src/app/node_modules/postgres/cjs/src/connection.js:384:17) at Socket.error (/usr/src/app/node_modules/postgres/cjs/src/connection.js:376:5) at Socket.emit (node:events:518:28) at emitErrorNT (node:internal/streams/destroy:170:8) at emitErrorCloseNT (node:internal/streams/destroy:129:3) at process.processTicksAndRejections (node:internal/process/task_queues:90:21) microservices worker exited with code 1 Killing api process ` I thought I did something silly, but the immich network worked fine and I could telnet from the database from the immich_server container... I checked the environment variables you could set and I noticed a variable called DB_HOSTNAME which defaults to 'database' which is not the hostname set on the docker-compose.yml file After I added the DB_HOSTNAME and set it to immich_postgres the immich_server container worked correctly So I wonder... Is this environment variable missing from the .env file and the docker-compose.yml file? I don't have a docker host yet I can provide my Ansible tasks and you can see they're practically the same ``` --- - name: Create Immich Server Quadlet file become: true become_user: '{{ immich_user }}' notify: Restart Immich containers.podman.podman_container: name: '{{ immich_server_container }}' image: ghcr.io/immich-app/immich-server:release state: quadlet quadlet_filename: '{{ immich_server_container }}' ports: - '{{ immich_http_port | default(2283) }}:2283' network: '{{ immich_network }}' volumes: - '{{ immich_library_dir }}:/usr/src/app/upload' - /etc/localtime:/etc/localtime:ro env: PUID: '1000' PGID: '1000' TZ: '{{ tz }}' # immich_server won't start unless I add this variable DB_HOSTNAME: '{{ immich_db_host }}' DB_DATABASE_NAME: '{{ immich_db_name }}' DB_USERNAME: '{{ immich_db_user }}' DB_PASSWORD: '{{ immich_db_pass }}' quadlet_options: - 'AutoUpdate=registry' - 'Pull=newer' - | [Service] Restart=always RestartSec=10 - | [Install] WantedBy=default.target multi-user.target - name: Create Immich Machine Learning Quadlet file become: true become_user: '{{ immich_user }}' notify: Restart Immich Machine Learning containers.podman.podman_container: name: '{{ immich_machine_learning_container }}' image: ghcr.io/immich-app/immich-machine-learning:release state: quadlet quadlet_filename: '{{ immich_machine_learning_container }}' network: '{{ immich_network }}' volumes: - '{{ immich_machine_learning_dir }}:/usr/src/app/upload' env: PUID: '1000' PGID: '1000' TZ: '{{ tz }}' quadlet_options: - 'AutoUpdate=registry' - 'Pull=newer' - | [Service] Restart=always RestartSec=10 - | [Install] WantedBy=default.target multi-user.target - name: Create Redis Quadlet file become: true become_user: '{{ immich_user }}' notify: Restart Immich Redis containers.podman.podman_container: name: '{{ immich_redis_container }}' image: docker.io/redis:6.2-alpine@sha256:148bb5411c184abd288d9aaed139c98123eeb8824c5d3fce03cf721db58066d8 state: quadlet quadlet_filename: '{{ immich_redis_container }}' network: '{{ immich_network }}' env: PUID: '1000' PGID: '1000' TZ: '{{ tz }}' quadlet_options: - 'AutoUpdate=registry' - 'Pull=newer' - | [Service] Restart=always RestartSec=10 - | [Install] WantedBy=default.target multi-user.target ``` And here's how I deploy Postgres ``` --- - name: Set postgres_volumes fact ansible.builtin.set_fact: postgres_volumes: - '{{ (postgres_data_dir is defined | ternary(postgres_data_dir, postgres_data_vol)) }}:/var/lib/postgresql/data' - name: Append postgres_init_script volume if defined ansible.builtin.set_fact: postgres_volumes: "{{ postgres_volumes + [postgres_init_script + ':/docker-entrypoint-initdb.d/initdb.sql:z'] }}" when: postgres_init_script is defined - name: Create Postgres Quadlet file become: true become_user: '{{ postgres_podman_user }}' notify: Restart Postgres containers.podman.podman_container: name: '{{ postgres_container }}' image: '{{ postgres_image | default("docker.io/postgres:latest") }}' userns: "{{ 'auto' if postgres_data_dir is defined or postgres_init_script is defined else '' }}" network: '{{ postgres_network }}' state: quadlet quadlet_filename: '{{ postgres_container }}' ports: - '5432:5432' volumes: '{{ postgres_volumes }}' command: '{{ postgres_command | default(omit) }}' env: PUID: '1000' PGID: '1000' TZ: '{{ tz }}' POSTGRES_DB: '{{ postgres_db }}' POSTGRES_USER: '{{ postgres_user }}' POSTGRES_PASSWORD: '{{ postgres_pass }}' POSTGRES_INITDB_ARGS: '{{ postgres_initdb_args | default(omit) }}' quadlet_options: - 'AutoUpdate=registry' - 'Pull=newer' - | [Service] Restart=always RestartSec=10 - | [Install] WantedBy=default.target multi-user.target ``` They're all in the same network and immich_server will only start when I set DB_HOSTNAME to immich_server which ### The OS that Immich Server is running on Debian 13 ### Version of Immich Server release ### Version of Immich Mobile App N/A ### Platform with the issue - [x] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML # # WARNING: To install Immich, follow our guide: https://immich.app/docs/install/docker-compose # # 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: cpu # 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 - /etc/localtime:/etc/localtime:ro env_file: - .env ports: - '2283: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, rocm, openvino, rknn] to the image tag. # Example tag: ${IMMICH_VERSION:-release}-cuda image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration # file: hwaccel.ml.yml # service: cpu # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] 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:148bb5411c184abd288d9aaed139c98123eeb8824c5d3fce03cf721db58066d8 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:739cdd626151ff1f796dc95a6591b55a714f341c737e27f045019ceabf8e8c52 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="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" || exit 1; Chksum="$$(psql --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --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: ``` ### Your .env content ```Shell # 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=./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.wikipedia.org/wiki/List_of_tz_database_time_zones#List # 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=postgres # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich ``` ### Reproduction steps 1. Download docker-compose.yml and .env file from https://immich.app/docs/install/docker-compose 2. Adapt it to run with Podman 3. immich_server keeps restarting because it won't find Postgres, which I think it happens because it is looking for 'database' but postgres host was set to immich_postgres ### Relevant log output ```shell ``` ### Additional information _No response_
Author
Owner

@dpkg-i-foo-deb commented on GitHub (Apr 6, 2025):

I just set up a container host with Docker installed and it works 200% perfect... I ping 'database' from immich_server installed in Docker and I get a response back

PING database (172.18.0.4): 56 data bytes
64 bytes from 172.18.0.4: icmp_seq=0 ttl=64 time=0.035 ms
64 bytes from 172.18.0.4: icmp_seq=1 ttl=64 time=0.054 ms

But when I do this from Podman...

root@12c833124b59:/usr/src/app# ping database
ping: unknown host

Yet I don't see any hostname definition for 'database' in the docker-compose.yml file that would have made me add a new host to immich_server in my Quadlet file...

@dpkg-i-foo-deb commented on GitHub (Apr 6, 2025): I just set up a container host with Docker installed and it works 200% perfect... I ping 'database' from immich_server installed in Docker and I get a response back ``` PING database (172.18.0.4): 56 data bytes 64 bytes from 172.18.0.4: icmp_seq=0 ttl=64 time=0.035 ms 64 bytes from 172.18.0.4: icmp_seq=1 ttl=64 time=0.054 ms ``` But when I do this from Podman... ``` root@12c833124b59:/usr/src/app# ping database ping: unknown host ``` Yet I don't see any hostname definition for 'database' in the docker-compose.yml file that would have made me add a new host to immich_server in my Quadlet file...
Author
Owner

@bo0tzz commented on GitHub (Apr 6, 2025):

The server defaults to database if DB_HOSTNAME is not set.

@bo0tzz commented on GitHub (Apr 6, 2025): The server defaults to `database` if DB_HOSTNAME is not set.
Author
Owner

@danieldietzler commented on GitHub (Apr 6, 2025):

Yet I don't see any hostname definition for 'database' in the docker-compose.yml file that would have made me add a new host to immich_server in my Quadlet file...

Also, with docker compose the service name always also becomes a valid host for that container inside the default stack network, which is why database works in the first place. Setting hostname explicitly is redundant in this case.

@danieldietzler commented on GitHub (Apr 6, 2025): > Yet I don't see any hostname definition for 'database' in the docker-compose.yml file that would have made me add a new host to immich_server in my Quadlet file... Also, with docker compose the service name always also becomes a valid host for that container inside the default stack network, which is why `database` works in the first place. Setting hostname explicitly is redundant in this case.
Author
Owner

@dpkg-i-foo-deb commented on GitHub (Apr 7, 2025):

The server defaults to database if DB_HOSTNAME is not set.

Well, of course it defaults to it. As I said on my issue, I read about it, yet it won't work when using Podman since the immich_postgres doesn't have the 'database' host. I understand Podman is not an official way to deploy this. But it would be a nice thing to specify this somehow when using something other than Docker

@dpkg-i-foo-deb commented on GitHub (Apr 7, 2025): > The server defaults to `database` if DB_HOSTNAME is not set. Well, of course it defaults to it. As I said on my issue, I read about it, yet it won't work when using Podman since the immich_postgres doesn't have the 'database' host. I understand Podman is not an official way to deploy this. But it would be a nice thing to specify this somehow when using something other than Docker
Author
Owner

@dpkg-i-foo-deb commented on GitHub (Apr 7, 2025):

Yet I don't see any hostname definition for 'database' in the docker-compose.yml file that would have made me add a new host to immich_server in my Quadlet file...

Also, with docker compose the service name always also becomes a valid host for that container inside the default stack network, which is why database works in the first place. Setting hostname explicitly is redundant in this case.

Yes, yet you didn't read my Issue because I'm not using Docker, I deployet it with Podman :)

@dpkg-i-foo-deb commented on GitHub (Apr 7, 2025): > > Yet I don't see any hostname definition for 'database' in the docker-compose.yml file that would have made me add a new host to immich_server in my Quadlet file... > > Also, with docker compose the service name always also becomes a valid host for that container inside the default stack network, which is why `database` works in the first place. Setting hostname explicitly is redundant in this case. Yes, yet you didn't read my Issue because I'm not using Docker, I deployet it with Podman :)
Author
Owner

@dpkg-i-foo-deb commented on GitHub (Apr 7, 2025):

Well, since maintainers gave 0 effort on understanding or even reading the actual issue I'll let this here so maybe it helps somebody

If you're deploying this using Podman, you must set DB_HOSTNAME to the name of your postgres container 'immich_postgres' in my case. Otherwise immich_server will crash all the time without any actual useful log because it doesn't know about the 'database' host which is the default and works when deploying with Docker

This is how my Quadlets look in the end

.config/containers/systemd/immich_server.container

[Container]
ContainerName=immich_server
Environment=PUID=1000
Environment=PGID=1000
Environment=TZ=America/Bogota
Environment=DB_HOSTNAME=immich_postgres
Environment=DB_DATABASE_NAME=immich
Environment=DB_USERNAME=postgres
Environment=DB_PASSWORD=<your-password>
Image=ghcr.io/immich-app/immich-server:release
Network=immich
PublishPort=2283:2283
Volume=/photos:/usr/src/app/upload
Volume=/etc/localtime:/etc/localtime:ro
AutoUpdate=registry
Pull=newer
[Service]
Restart=always
RestartSec=10

[Install]
WantedBy=default.target multi-user.target

.config/containers/systemd/immich_postgres.container

[Container]
ContainerName=immich_postgres
Environment=PUID=1000
Environment=PGID=1000
Environment=TZ=America/Bogota
Environment=POSTGRES_DB=immich
Environment=POSTGRES_USER=postgres
Environment=POSTGRES_PASSWORD=<your-password>
Environment=POSTGRES_INITDB_ARGS=--data-checksums
Exec=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
Image=docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:739cdd626151ff1f796dc95a6591b55a714f341c737e27f045019ceabf8e8c52
Network=immich
PublishPort=5432:5432
UserNS=
Volume=immich_postgres:/var/lib/postgresql/data
AutoUpdate=registry
Pull=newer
[Service]
Restart=always
RestartSec=10

[Install]
WantedBy=default.target multi-user.target

.config/containers/systemd/immich_machine_learning.container

[Container]
ContainerName=immich_machine_learning
Environment=PUID=1000
Environment=PGID=1000
Environment=TZ=America/Bogota
Image=ghcr.io/immich-app/immich-machine-learning:release
Network=immich
Volume=/cache/immich-machine-learning:/usr/src/app/upload
AutoUpdate=registry
Pull=newer
[Service]
Restart=always
RestartSec=10

[Install]
WantedBy=default.target multi-user.target
@dpkg-i-foo-deb commented on GitHub (Apr 7, 2025): Well, since maintainers gave 0 effort on understanding or even reading the actual issue I'll let this here so maybe it helps somebody If you're deploying this using Podman, you must set DB_HOSTNAME to the name of your postgres container 'immich_postgres' in my case. Otherwise immich_server will crash all the time without any actual useful log because it doesn't know about the 'database' host which is the default and works when deploying with Docker This is how my Quadlets look in the end .config/containers/systemd/immich_server.container ``` [Container] ContainerName=immich_server Environment=PUID=1000 Environment=PGID=1000 Environment=TZ=America/Bogota Environment=DB_HOSTNAME=immich_postgres Environment=DB_DATABASE_NAME=immich Environment=DB_USERNAME=postgres Environment=DB_PASSWORD=<your-password> Image=ghcr.io/immich-app/immich-server:release Network=immich PublishPort=2283:2283 Volume=/photos:/usr/src/app/upload Volume=/etc/localtime:/etc/localtime:ro AutoUpdate=registry Pull=newer [Service] Restart=always RestartSec=10 [Install] WantedBy=default.target multi-user.target ``` .config/containers/systemd/immich_postgres.container ``` [Container] ContainerName=immich_postgres Environment=PUID=1000 Environment=PGID=1000 Environment=TZ=America/Bogota Environment=POSTGRES_DB=immich Environment=POSTGRES_USER=postgres Environment=POSTGRES_PASSWORD=<your-password> Environment=POSTGRES_INITDB_ARGS=--data-checksums Exec=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 Image=docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:739cdd626151ff1f796dc95a6591b55a714f341c737e27f045019ceabf8e8c52 Network=immich PublishPort=5432:5432 UserNS= Volume=immich_postgres:/var/lib/postgresql/data AutoUpdate=registry Pull=newer [Service] Restart=always RestartSec=10 [Install] WantedBy=default.target multi-user.target ``` .config/containers/systemd/immich_machine_learning.container ``` [Container] ContainerName=immich_machine_learning Environment=PUID=1000 Environment=PGID=1000 Environment=TZ=America/Bogota Image=ghcr.io/immich-app/immich-machine-learning:release Network=immich Volume=/cache/immich-machine-learning:/usr/src/app/upload AutoUpdate=registry Pull=newer [Service] Restart=always RestartSec=10 [Install] WantedBy=default.target multi-user.target ```
Author
Owner

@danieldietzler commented on GitHub (Apr 7, 2025):

Yet I don't see any hostname definition for 'database' in the docker-compose.yml file that would have made me add a new host to immich_server in my Quadlet file...

Also, with docker compose the service name always also becomes a valid host for that container inside the default stack network, which is why database works in the first place. Setting hostname explicitly is redundant in this case.

Yes, yet you didn't read my Issue because I'm not using Docker, I deployet it with Podman :)

I read your issue and I'm aware you're using podman. If diverging from the recommended/"official" way I think it's fair to expect the user to adapt their installation method accordingly though.

@danieldietzler commented on GitHub (Apr 7, 2025): > > > Yet I don't see any hostname definition for 'database' in the docker-compose.yml file that would have made me add a new host to immich_server in my Quadlet file... > > > > > > Also, with docker compose the service name always also becomes a valid host for that container inside the default stack network, which is why `database` works in the first place. Setting hostname explicitly is redundant in this case. > > Yes, yet you didn't read my Issue because I'm not using Docker, I deployet it with Podman :) I read your issue and I'm aware you're using podman. If diverging from the recommended/"official" way I think it's fair to expect the user to adapt their installation method accordingly though.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#5783