Friedrich Ewald My Personal Website

Immich on QNAP

I installed Immich on my QNAP NAS with the following Docker configuration, based on this Reddit post:

name: immich
services:
  
  database:
    container_name: immich_postgres
    image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23
    environment:
      POSTGRES_PASSWORD: immich #this has to be same what's on row 47
      POSTGRES_USER: postgres
      POSTGRES_DB: immich
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      - ./postgres:/var/lib/postgresql/data
    shm_size: 128mb
    restart: always
  
  redis:
    container_name: immich_redis
    image: docker.io/valkey/valkey:9@sha256:fb8d272e529ea567b9bf1302245796f21a2672b8368ca3fcb938ac334e613c8f
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always
  
  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:v2
    environment:
    - TZ=America/Los_Angeles
    - OPENVINO_DEVICE=AUTO
    volumes:
      - ./model-cache:/cache
    restart: always
    healthcheck:
      disable: false
  
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:v2
    devices:
      - /dev/dri:/dev/dri
    environment:
      - TZ=America/Los_Angeles
      - LIBVA_DRIVER_NAME=iHD
      - DB_HOST=database
      - DB_PORT=5432
      - DB_USERNAME=postgres
      - DB_PASSWORD=immich
      - DB_DATABASE_NAME=immich
      - REDIS_HOST=redis               
      - REDIS_PORT=6379
    volumes:
      - /share/Photos/Freddy:/home/user/photos1:ro #this is how to map folder from your NAS to immich, in this example my photos are located on the NAS at /share/CACHEDEV1_DATA/Multimedia/Photo, which is mapped to this in immich: /home/user/photos1
      - ./library:/data
      - /etc/localtime:/etc/localtime:ro
    ports:
      - '2283:2283'
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false
The important thing: The library needs to be added to have read only access to shared data so that data doesn’t need to live twice on the NAS. Read-only access ensures that the data doesn’t get modified.

About the author

is a Staff Software Engineer with a Master's degree in Computer Science. He started this website in late 2015, mostly as a digital business card. He is interested in Go, Python, Ruby, SQL- and NoSQL-databases, machine learning and AI and is experienced in building scalable, distributed systems and micro-services at multiple larger and smaller companies.