Immich + Redis + PostgreSQL
Deployment rootless
1. Prepare the host
Prerequisites once as root
Install Podman (needs podman 4.3 or newer; Ubuntu 22.04 ships 3.4 and is too old, use 24.04)
apt update && apt install -y podman
Create user (if not existing)
useradd -m -s /bin/bash immich passwd immich
Enable linger (services keep running after logout and start after reboot)
loginctl enable-linger immich
Switch to deployment user
su - immich
Use su - with the dash — this creates a proper login shell as immich. Without the dash, root environment variables carry over and rootless Podman will not work correctly.
Fix environment for rootless systemd (new users only — skip if already set)
Required once so systemctl --user works in non-login sessions.
cat << 'EOF' >> ~/.bashrc # Fix for systemd user services (rootless Podman/systemctl) export XDG_RUNTIME_DIR=/run/user/$(id -u) export DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/bus EOF source ~/.bashrc
2. Choose a format and deploy
The same pod in four forms. Pick one and follow only its steps.
Each tab says which podman it needs. Check yours with podman --version:
Debian 12 ships 4.3, Ubuntu 24.04 4.9, Debian 13 5.4, Fedora 5.8, Arch 6.x.
Kubernetes YAML for podman kube play, started by systemd through a Quadlet .kube unit (podman 4.4+; older podman like Debian 12 uses podman-kube@, see the version check below).
Kubernetes YAML
apiVersion: v1
kind: Pod
metadata:
name: immich
labels:
app: immich
spec:
restartPolicy: Always
containers:
- name: immich-server
image: ghcr.io/immich-app/immich-server:release
ports:
- containerPort: 2283
hostPort: 2283
env:
- name: DB_HOSTNAME
value: 127.0.0.1
- name: DB_PORT
value: '5432'
- name: DB_DATABASE_NAME
value: immich
- name: DB_USERNAME
value: immich
- name: DB_PASSWORD
value: JIrocn0Ejwj7PCJPlZkhow
- name: REDIS_HOSTNAME
value: 127.0.0.1
- name: UPLOAD_LOCATION
value: /usr/src/app/upload
volumeMounts:
- name: vol-0
mountPath: /usr/src/app/upload
- name: redis
image: docker.io/redis:7-alpine
volumeMounts:
- name: vol-1
mountPath: /data
command:
- redis-server
- --appendonly
- 'yes'
- name: postgres
image: docker.io/tensorchord/pgvecto-rs:pg16-v0.2.0
env:
- name: POSTGRES_USER
value: immich
- name: POSTGRES_PASSWORD
value: JIrocn0Ejwj7PCJPlZkhow
- name: POSTGRES_DB
value: immich
volumeMounts:
- name: vol-2
mountPath: /var/lib/postgresql/data
securityContext:
runAsUser: 999
runAsGroup: 999
volumes:
- name: vol-0
persistentVolumeClaim:
claimName: immich-upload
- name: vol-1
persistentVolumeClaim:
claimName: immich-redis
- name: vol-2
persistentVolumeClaim:
claimName: immich-db
Save the YAML file
mkdir -p ~/.config/containers/ nano ~/.config/containers/immich.yaml
Test the pod (without autostart)
podman kube play ~/.config/containers/immich.yaml # Check status: podman pod ps && podman ps # Stop: podman kube down ~/.config/containers/immich.yaml
Check your podman version
podman --version
4.4 or newer: continue with step 3 below.
Older, e.g. 4.3 on Debian 12? There is no Quadlet yet: use podman's own podman-kube@ service instead of steps 3–5
systemctl --user enable --now podman-kube@$(systemd-escape ~/.config/containers/immich.yaml).service # Status & logs: systemctl --user status podman-kube@$(systemd-escape ~/.config/containers/immich.yaml).service journalctl --user -u podman-kube@$(systemd-escape ~/.config/containers/immich.yaml).service -f
The day-to-day commands below have a block for this service.
Create Quadlet .kube file
[Unit] Description=immich pod After=network-online.target Wants=network-online.target [Kube] Yaml=%h/.config/containers/immich.yaml [Service] Restart=always [Install] WantedBy=default.target
%h is a systemd home-directory specifier — do not replace it with ~/.
Save to ~/.config/containers/systemd/:
mkdir -p ~/.config/containers/systemd/ nano ~/.config/containers/systemd/immich.kube
Start systemd service
systemctl --user daemon-reload systemctl --user start immich.service
Status & Logs
systemctl --user status immich.service journalctl --user -u immich.service -f podman pod ps podman ps
Enable automatic image updates optional
Requires AutoUpdate=registry in the .kube file. Podman then checks for new images and restarts the pod automatically:
systemctl --user enable --now podman.socket systemctl --user daemon-reload systemctl --user enable --now podman-auto-update.timer # Check status: systemctl --user status podman-auto-update.timer # Trigger manually: podman auto-update
Day-to-day logs, restart, update, remove (click to open)
Logs & shell into a container
podman logs -f immich-immich-server podman logs -f immich-redis podman logs -f immich-postgres podman exec -it immich-immich-server /bin/sh
Restart
systemctl --user restart immich.service
Update an image by hand
Pull the new version, the restart recreates the containers from it:
podman pull <image>:<tag> systemctl --user restart immich.service
Stop & remove
Stop through systemd, otherwise Restart=always brings the pod back. To remove it for good, delete the unit files and reload:
systemctl --user stop immich.service rm ~/.config/containers/systemd/immich.kube systemctl --user daemon-reload
podman older than 4.4 (podman-kube@ from step 3)
systemctl --user restart podman-kube@$(systemd-escape ~/.config/containers/immich.yaml).service # Update an image: pull, then restart as above podman pull <image>:<tag> # Stop and remove from autostart: systemctl --user disable --now podman-kube@$(systemd-escape ~/.config/containers/immich.yaml).service
Delete the data — permanent, only after stop & remove
podman volume rm immich-upload podman volume rm immich-redis podman volume rm immich-db
Native systemd units without the Kubernetes YAML: one .pod plus one .container per container.
Each container becomes its own systemd service (restart, logs and ordering per container).
Needs podman 5.0 or newer — Debian 12 ships 4.3, use the Kube YAML tab there.
Save the unit files
[Unit] Description=immich pod [Pod] PodName=immich PublishPort=2283:2283
[Unit] Description=immich-immich-server container [Container] Image=ghcr.io/immich-app/immich-server:release Pod=immich.pod ContainerName=immich-immich-server Environment=DB_HOSTNAME=127.0.0.1 Environment=DB_PORT=5432 Environment=DB_DATABASE_NAME=immich Environment=DB_USERNAME=immich Environment=DB_PASSWORD=JIrocn0Ejwj7PCJPlZkhow Environment=REDIS_HOSTNAME=127.0.0.1 Environment=UPLOAD_LOCATION=/usr/src/app/upload Volume=immich-upload:/usr/src/app/upload:Z [Service] Restart=always [Install] WantedBy=default.target
[Unit] Description=immich-redis container [Container] Image=docker.io/redis:7-alpine Pod=immich.pod ContainerName=immich-redis Volume=immich-redis:/data:Z Entrypoint=redis-server Exec=--appendonly yes [Service] Restart=always [Install] WantedBy=default.target
[Unit] Description=immich-postgres container [Container] Image=docker.io/tensorchord/pgvecto-rs:pg16-v0.2.0 Pod=immich.pod ContainerName=immich-postgres Environment=POSTGRES_USER=immich Environment=POSTGRES_PASSWORD=JIrocn0Ejwj7PCJPlZkhow Environment=POSTGRES_DB=immich Volume=immich-db:/var/lib/postgresql/data:Z User=999 Group=999 [Service] Restart=always [Install] WantedBy=default.target
Save all of them to ~/.config/containers/systemd/:
mkdir -p ~/.config/containers/systemd/ nano ~/.config/containers/systemd/immich.pod nano ~/.config/containers/systemd/immich-immich-server.container nano ~/.config/containers/systemd/immich-redis.container nano ~/.config/containers/systemd/immich-postgres.container
Start the pod
The pod service pulls in every container service. Autostart at boot comes from the [Install] section of the units, no enable needed.
systemctl --user daemon-reload systemctl --user start immich-pod.service
Status & Logs
systemctl --user status immich-pod.service journalctl --user -u immich-immich-server.service -f journalctl --user -u immich-redis.service -f journalctl --user -u immich-postgres.service -f podman pod ps && podman ps
Day-to-day logs, restart, update, remove (click to open)
Logs & shell into a container
podman logs -f immich-immich-server podman logs -f immich-redis podman logs -f immich-postgres podman exec -it immich-immich-server /bin/sh
Restart
systemctl --user restart immich-pod.service
Update an image by hand
Pull the new version, the restart recreates the containers from it:
podman pull <image>:<tag> systemctl --user restart immich-pod.service
Stop & remove
Stop through systemd, otherwise Restart=always brings the pod back. To remove it for good, delete the unit files and reload:
systemctl --user stop immich-pod.service rm ~/.config/containers/systemd/immich.pod rm ~/.config/containers/systemd/immich-immich-server.container rm ~/.config/containers/systemd/immich-redis.container rm ~/.config/containers/systemd/immich-postgres.container systemctl --user daemon-reload
Delete the data — permanent, only after stop & remove
podman volume rm immich-upload podman volume rm immich-redis podman volume rm immich-db
A docker-compose.yml for podman-compose. Handy if you already work with Compose; there are no per-container systemd services.
Install podman-compose as root
Run this as root, e.g. together with the prerequisites before su - immich.
apt install -y podman-compose
Save the compose file
services:
immich-server:
image: ghcr.io/immich-app/immich-server:release
restart: always
environment:
- DB_HOSTNAME=127.0.0.1
- DB_PORT=5432
- DB_DATABASE_NAME=immich
- DB_USERNAME=immich
- DB_PASSWORD=JIrocn0Ejwj7PCJPlZkhow
- REDIS_HOSTNAME=127.0.0.1
- UPLOAD_LOCATION=/usr/src/app/upload
depends_on:
redis:
condition: service_started
volumes:
- immich-upload:/usr/src/app/upload:Z
network_mode: service:redis
redis:
image: docker.io/redis:7-alpine
restart: always
entrypoint:
- redis-server
- --appendonly
- 'yes'
volumes:
- immich-redis:/data:Z
ports:
- 2283:2283
postgres:
image: docker.io/tensorchord/pgvecto-rs:pg16-v0.2.0
restart: always
environment:
- POSTGRES_USER=immich
- POSTGRES_PASSWORD=JIrocn0Ejwj7PCJPlZkhow
- POSTGRES_DB=immich
user: 999:999
depends_on:
redis:
condition: service_started
volumes:
- immich-db:/var/lib/postgresql/data:Z
network_mode: service:redis
volumes:
immich-upload: null
immich-redis: null
immich-db: null
mkdir -p ~/immich nano ~/immich/docker-compose.yml
Start, status & logs
cd ~/immich podman-compose up -d podman-compose ps podman-compose logs -f # Stop: podman-compose down
Start after reboot
podman-restart.service starts every container with restart: always at boot:
systemctl --user enable podman-restart.service
Update images
cd ~/immich podman-compose pull podman-compose up -d
Day-to-day logs, restart, update, remove (click to open)
Logs & shell into a container
podman logs -f immich_immich-server_1 podman logs -f immich_redis_1 podman logs -f immich_postgres_1 podman exec -it immich_immich-server_1 /bin/sh
Restart
cd ~/immich podman-compose restart
Stop & remove
cd ~/immich podman-compose down
Delete the data — permanent, only after stop & remove
podman volume rm immich_immich-upload podman volume rm immich_immich-redis podman volume rm immich_immich-db
Plain podman pod create / podman create commands. Good for a quick test or to see what happens under the hood.
Save the script
#!/bin/bash set -e # ── Create named volumes ─────────────────────────────────────────── # Named volumes are created automatically — no UID/GID permission adjustment needed. podman volume exists immich-upload || podman volume create immich-upload podman volume exists immich-redis || podman volume create immich-redis podman volume exists immich-db || podman volume create immich-db # ── Create pod ───────────────────────────────────────────────────── podman pod create \ --name immich \ -p 2283:2283 # ── Container: immich-immich-server ───────────────────────────────────────────── podman create \ --pod immich \ --name immich-immich-server \ --restart always \ -e DB_HOSTNAME='127.0.0.1' \ -e DB_PORT='5432' \ -e DB_DATABASE_NAME='immich' \ -e DB_USERNAME='immich' \ -e DB_PASSWORD='JIrocn0Ejwj7PCJPlZkhow' \ -e REDIS_HOSTNAME='127.0.0.1' \ -e UPLOAD_LOCATION='/usr/src/app/upload' \ -v immich-upload:/usr/src/app/upload:Z \ ghcr.io/immich-app/immich-server:release # ── Container: immich-redis ───────────────────────────────────────────── podman create \ --pod immich \ --name immich-redis \ --restart always \ -v immich-redis:/data:Z \ --entrypoint redis-server \ docker.io/redis:7-alpine \ --appendonly yes # ── Container: immich-postgres ───────────────────────────────────────────── podman create \ --pod immich \ --name immich-postgres \ --restart always \ -e POSTGRES_USER='immich' \ -e POSTGRES_PASSWORD='JIrocn0Ejwj7PCJPlZkhow' \ -e POSTGRES_DB='immich' \ -v immich-db:/var/lib/postgresql/data:Z \ --user 999:999 \ docker.io/tensorchord/pgvecto-rs:pg16-v0.2.0 # ── Start pod ────────────────────────────────────────────────────── podman pod start immich # ── Stop & clean up ─────────────────────────────────────────────── # podman pod stop immich # podman pod rm immich
nano immich.sh
Run it, status & logs
bash immich.sh podman pod ps && podman ps podman logs -f <container-name>
Start after reboot
podman-restart.service starts every container with --restart always at boot:
systemctl --user enable podman-restart.service
Remove or rebuild
The script creates the pod once. To apply changes or new images, remove the pod and run the script again (named volumes stay):
podman pod rm -f immich bash immich.sh
Day-to-day logs, restart, update, remove (click to open)
Logs & shell into a container
podman logs -f immich-immich-server podman logs -f immich-redis podman logs -f immich-postgres podman exec -it immich-immich-server /bin/sh
Restart
podman pod stop immich podman pod start immich
Stop & remove
podman pod rm -f immich
Delete the data — permanent, only after stop & remove
podman volume rm immich-upload podman volume rm immich-redis podman volume rm immich-db
Ports < 1024 (e.g. 80, 443)
Rootless cannot open privileged ports. Solution:
sysctl net.ipv4.ip_unprivileged_port_start=80
Make persistent in /etc/sysctl.d/99-podman.conf.
Containers communicate via localhost
All containers in the pod share the same network namespace. Always use localhost, not container names.
# Correct (e.g. app → db): localhost:5432 # Wrong (doesn't work in a pod): db-container:5432
List open ports
Which ports are the running containers publishing? See the PORTS column:
podman ps
Custom DNS for the pod
Set a custom DNS server (e.g. local Pi-hole) in the generator under DNS server. Every format picks it up.
Set volume ownership
Fix permission errors by adjusting UID/GID in the user namespace:
podman unshare chown 1000:1000 /path/to/volume
SELinux volume labels
On SELinux systems (RHEL, Fedora) set the volume suffix:
/host/path:/container/path:Z # private /host/path:/container/path:z # shared
List all volumes
podman volume ls podman volume inspect <volume-name>
Volume backup
Back up data from a named volume:
podman run --rm \ -v <volume-name>:/data:ro \ -v $(pwd):/backup \ busybox tar czf /backup/backup.tar.gz /data
Cleanup
Remove unused images, containers and volumes:
podman system prune -f # containers + images podman image prune -f # untagged images only podman volume prune -f # unused volumes
Check for outdated images
List local images; auto-update only covers units with AutoUpdate= (Kube and Quadlet tabs):
podman images podman auto-update --dry-run
All containers, including stopped ones
podman pod ps podman ps -a
Resource usage
podman stats --no-stream