PhotoPrism
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 photoprism passwd photoprism
Enable linger (services keep running after logout and start after reboot)
loginctl enable-linger photoprism
Switch to deployment user
su - photoprism
Use su - with the dash — this creates a proper login shell as photoprism. 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: photoprism
labels:
app: photoprism
spec:
restartPolicy: Always
containers:
- name: photoprism
image: docker.io/photoprism/photoprism:latest
imagePullPolicy: Always
ports:
- containerPort: 2342
hostPort: 2342
env:
- name: PHOTOPRISM_ADMIN_USER
value: admin
- name: PHOTOPRISM_ADMIN_PASSWORD
value: yCeAx5jCqZFTqj_cqgVCgg
- name: PHOTOPRISM_SITE_URL
value: http://localhost:2342/
- name: PHOTOPRISM_DATABASE_DRIVER
value: mysql
- name: PHOTOPRISM_DATABASE_SERVER
value: 127.0.0.1:3306
- name: PHOTOPRISM_DATABASE_NAME
value: photoprism
- name: PHOTOPRISM_DATABASE_USER
value: photoprism
- name: PHOTOPRISM_DATABASE_PASSWORD
value: yCeAx5jCqZFTqj_cqgVCgg
- name: TZ
value: Europe/Vienna
volumeMounts:
- name: vol-0
mountPath: /photoprism/originals
- name: vol-1
mountPath: /photoprism/storage
- name: mariadb
image: docker.io/mariadb:11
env:
- name: MARIADB_ROOT_PASSWORD
value: Tt4MbxQzozUqBs5hAfM7vA
- name: MARIADB_USER
value: photoprism
- name: MARIADB_PASSWORD
value: yCeAx5jCqZFTqj_cqgVCgg
- name: MARIADB_DATABASE
value: photoprism
volumeMounts:
- name: vol-2
mountPath: /var/lib/mysql
securityContext:
runAsUser: 999
runAsGroup: 999
volumes:
- name: vol-0
persistentVolumeClaim:
claimName: photoprism-originals
- name: vol-1
persistentVolumeClaim:
claimName: photoprism-storage
- name: vol-2
persistentVolumeClaim:
claimName: photoprism-db
Save the YAML file
mkdir -p ~/.config/containers/ nano ~/.config/containers/photoprism.yaml
Test the pod (without autostart)
podman kube play ~/.config/containers/photoprism.yaml # Check status: podman pod ps && podman ps # Stop: podman kube down ~/.config/containers/photoprism.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/photoprism.yaml).service # Status & logs: systemctl --user status podman-kube@$(systemd-escape ~/.config/containers/photoprism.yaml).service journalctl --user -u podman-kube@$(systemd-escape ~/.config/containers/photoprism.yaml).service -f
The day-to-day commands below have a block for this service.
Create Quadlet .kube file
[Unit] Description=photoprism pod After=network-online.target Wants=network-online.target [Kube] Yaml=%h/.config/containers/photoprism.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/photoprism.kube
Start systemd service
systemctl --user daemon-reload systemctl --user start photoprism.service
Status & Logs
systemctl --user status photoprism.service journalctl --user -u photoprism.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 photoprism-photoprism podman logs -f photoprism-mariadb podman exec -it photoprism-photoprism /bin/sh
Restart
systemctl --user restart photoprism.service
Update an image by hand
Pull the new version, the restart recreates the containers from it:
podman pull <image>:<tag> systemctl --user restart photoprism.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 photoprism.service rm ~/.config/containers/systemd/photoprism.kube systemctl --user daemon-reload
podman older than 4.4 (podman-kube@ from step 3)
systemctl --user restart podman-kube@$(systemd-escape ~/.config/containers/photoprism.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/photoprism.yaml).service
Delete the data — permanent, only after stop & remove
podman volume rm photoprism-originals podman volume rm photoprism-storage podman volume rm photoprism-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=photoprism pod [Pod] PodName=photoprism PublishPort=2342:2342
[Unit] Description=photoprism-photoprism container [Container] Image=docker.io/photoprism/photoprism:latest Pod=photoprism.pod ContainerName=photoprism-photoprism Pull=always Environment=PHOTOPRISM_ADMIN_USER=admin Environment=PHOTOPRISM_ADMIN_PASSWORD=yCeAx5jCqZFTqj_cqgVCgg Environment=PHOTOPRISM_SITE_URL=http://localhost:2342/ Environment=PHOTOPRISM_DATABASE_DRIVER=mysql Environment=PHOTOPRISM_DATABASE_SERVER=127.0.0.1:3306 Environment=PHOTOPRISM_DATABASE_NAME=photoprism Environment=PHOTOPRISM_DATABASE_USER=photoprism Environment=PHOTOPRISM_DATABASE_PASSWORD=yCeAx5jCqZFTqj_cqgVCgg Environment=TZ=Europe/Vienna Volume=photoprism-originals:/photoprism/originals:Z Volume=photoprism-storage:/photoprism/storage:Z [Service] Restart=always [Install] WantedBy=default.target
[Unit] Description=photoprism-mariadb container [Container] Image=docker.io/mariadb:11 Pod=photoprism.pod ContainerName=photoprism-mariadb Environment=MARIADB_ROOT_PASSWORD=Tt4MbxQzozUqBs5hAfM7vA Environment=MARIADB_USER=photoprism Environment=MARIADB_PASSWORD=yCeAx5jCqZFTqj_cqgVCgg Environment=MARIADB_DATABASE=photoprism Volume=photoprism-db:/var/lib/mysql: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/photoprism.pod nano ~/.config/containers/systemd/photoprism-photoprism.container nano ~/.config/containers/systemd/photoprism-mariadb.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 photoprism-pod.service
Status & Logs
systemctl --user status photoprism-pod.service journalctl --user -u photoprism-photoprism.service -f journalctl --user -u photoprism-mariadb.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 photoprism-photoprism podman logs -f photoprism-mariadb podman exec -it photoprism-photoprism /bin/sh
Restart
systemctl --user restart photoprism-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 photoprism-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 photoprism-pod.service rm ~/.config/containers/systemd/photoprism.pod rm ~/.config/containers/systemd/photoprism-photoprism.container rm ~/.config/containers/systemd/photoprism-mariadb.container systemctl --user daemon-reload
Delete the data — permanent, only after stop & remove
podman volume rm photoprism-originals podman volume rm photoprism-storage podman volume rm photoprism-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 - photoprism.
apt install -y podman-compose
Save the compose file
services:
photoprism:
image: docker.io/photoprism/photoprism:latest
pull_policy: always
restart: always
environment:
- PHOTOPRISM_ADMIN_USER=admin
- PHOTOPRISM_ADMIN_PASSWORD=yCeAx5jCqZFTqj_cqgVCgg
- PHOTOPRISM_SITE_URL=http://localhost:2342/
- PHOTOPRISM_DATABASE_DRIVER=mysql
- PHOTOPRISM_DATABASE_SERVER=127.0.0.1:3306
- PHOTOPRISM_DATABASE_NAME=photoprism
- PHOTOPRISM_DATABASE_USER=photoprism
- PHOTOPRISM_DATABASE_PASSWORD=yCeAx5jCqZFTqj_cqgVCgg
- TZ=Europe/Vienna
depends_on:
mariadb:
condition: service_started
volumes:
- photoprism-originals:/photoprism/originals:Z
- photoprism-storage:/photoprism/storage:Z
network_mode: service:mariadb
mariadb:
image: docker.io/mariadb:11
restart: always
environment:
- MARIADB_ROOT_PASSWORD=Tt4MbxQzozUqBs5hAfM7vA
- MARIADB_USER=photoprism
- MARIADB_PASSWORD=yCeAx5jCqZFTqj_cqgVCgg
- MARIADB_DATABASE=photoprism
user: 999:999
volumes:
- photoprism-db:/var/lib/mysql:Z
ports:
- 2342:2342
volumes:
photoprism-originals: null
photoprism-storage: null
photoprism-db: null
mkdir -p ~/photoprism nano ~/photoprism/docker-compose.yml
Start, status & logs
cd ~/photoprism 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 ~/photoprism 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 photoprism_photoprism_1 podman logs -f photoprism_mariadb_1 podman exec -it photoprism_photoprism_1 /bin/sh
Restart
cd ~/photoprism podman-compose restart
Stop & remove
cd ~/photoprism podman-compose down
Delete the data — permanent, only after stop & remove
podman volume rm photoprism_photoprism-originals podman volume rm photoprism_photoprism-storage podman volume rm photoprism_photoprism-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 photoprism-originals || podman volume create photoprism-originals podman volume exists photoprism-storage || podman volume create photoprism-storage podman volume exists photoprism-db || podman volume create photoprism-db # ── Create pod ───────────────────────────────────────────────────── podman pod create \ --name photoprism \ -p 2342:2342 # ── Container: photoprism-photoprism ───────────────────────────────────────────── podman create \ --pod photoprism \ --name photoprism-photoprism \ --restart always \ --pull always \ -e PHOTOPRISM_ADMIN_USER='admin' \ -e PHOTOPRISM_ADMIN_PASSWORD='yCeAx5jCqZFTqj_cqgVCgg' \ -e PHOTOPRISM_SITE_URL='http://localhost:2342/' \ -e PHOTOPRISM_DATABASE_DRIVER='mysql' \ -e PHOTOPRISM_DATABASE_SERVER='127.0.0.1:3306' \ -e PHOTOPRISM_DATABASE_NAME='photoprism' \ -e PHOTOPRISM_DATABASE_USER='photoprism' \ -e PHOTOPRISM_DATABASE_PASSWORD='yCeAx5jCqZFTqj_cqgVCgg' \ -e TZ='Europe/Vienna' \ -v photoprism-originals:/photoprism/originals:Z \ -v photoprism-storage:/photoprism/storage:Z \ docker.io/photoprism/photoprism:latest # ── Container: photoprism-mariadb ───────────────────────────────────────────── podman create \ --pod photoprism \ --name photoprism-mariadb \ --restart always \ -e MARIADB_ROOT_PASSWORD='Tt4MbxQzozUqBs5hAfM7vA' \ -e MARIADB_USER='photoprism' \ -e MARIADB_PASSWORD='yCeAx5jCqZFTqj_cqgVCgg' \ -e MARIADB_DATABASE='photoprism' \ -v photoprism-db:/var/lib/mysql:Z \ --user 999:999 \ docker.io/mariadb:11 # ── Start pod ────────────────────────────────────────────────────── podman pod start photoprism # ── Stop & clean up ─────────────────────────────────────────────── # podman pod stop photoprism # podman pod rm photoprism
nano photoprism.sh
Run it, status & logs
bash photoprism.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 photoprism bash photoprism.sh
Day-to-day logs, restart, update, remove (click to open)
Logs & shell into a container
podman logs -f photoprism-photoprism podman logs -f photoprism-mariadb podman exec -it photoprism-photoprism /bin/sh
Restart
podman pod stop photoprism podman pod start photoprism
Stop & remove
podman pod rm -f photoprism
Delete the data — permanent, only after stop & remove
podman volume rm photoprism-originals podman volume rm photoprism-storage podman volume rm photoprism-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