Photoprism
Stack
PhotoPrism is an AI-powered app for browsing, organizing & sharing your photo collection. It makes use of the latest technologies to tag and find pictures automatically without getting in your way.| Copy as Custom stack and EDIT environment variables.
Services
photoprism
Configuration
Imagephotoprism/photoprism:latest2342:2342/photoprism/originals : ~/Pictures/photoprism/storage : ./storagePHOTOPRISM_ADMIN_PASSWORD=insecurePHOTOPRISM_SITE_URL=http://localhost:2342/PHOTOPRISM_ORIGINALS_LIMIT=5000PHOTOPRISM_HTTP_COMPRESSION=gzipPHOTOPRISM_DEBUG=falsePHOTOPRISM_PUBLIC=falsePHOTOPRISM_READONLY=falsePHOTOPRISM_EXPERIMENTAL=falsePHOTOPRISM_DISABLE_CHOWN=falsePHOTOPRISM_DISABLE_WEBDAV=falsePHOTOPRISM_DISABLE_SETTINGS=falsePHOTOPRISM_DISABLE_TENSORFLOW=falsePHOTOPRISM_DISABLE_FACES=falsePHOTOPRISM_DISABLE_CLASSIFICATION=falsePHOTOPRISM_DARKTABLE_PRESETS=falsePHOTOPRISM_DETECT_NSFW=falsePHOTOPRISM_UPLOAD_NSFW=truePHOTOPRISM_DATABASE_DRIVER=mysqlPHOTOPRISM_DATABASE_SERVER=mariadb:3306PHOTOPRISM_DATABASE_NAME=photoprismPHOTOPRISM_DATABASE_USER=photoprismPHOTOPRISM_DATABASE_PASSWORD=insecurePHOTOPRISM_SITE_TITLE=PhotoPrismPHOTOPRISM_SITE_CAPTION=Browse Your LifePHOTOPRISM_SITE_DESCRIPTION=PHOTOPRISM_SITE_AUTHOR=HOME=/photoprismImage details
mariadb
Configuration
Imagemariadb:10.6mysqld --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=120/var/lib/mysql : ./databaseMYSQL_ROOT_PASSWORD=insecureMYSQL_DATABASE=photoprismMYSQL_USER=photoprismMYSQL_PASSWORD=insecureunless-stoppedImage details
Standalone Install
Select an install method, to see config/commands for deploying Photoprism
Install on Portainer
Import all app templates into your Portainer instance, for easy 1-click deploys
- Ensure both Docker and Portainer are installed, and up-to-date
- Log into your Portainer web UI
- Under Settings → App Templates, paste the below URL
- Head to Home → App Templates, and the list of apps will show up
- Select Photoprism, fill in any config options, and hit Deploy
Template Import URL
https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me
Original stackfile
The compose file this template deploys, straight from its repo:
# Example Docker Compose config file for PhotoPrism (Linux / AMD64)
#
# Documentation : https://docs.photoprism.org/getting-started/docker-compose/
# Docker Hub URL: https://hub.docker.com/r/photoprism/photoprism/
#
# Attention: When installing PhotoPrism on a public server outside your home network,
# always run it behind a secure HTTPS reverse proxy like Traefik, Caddy, or NGINX.
# Your files and passwords will be transmitted in clear text otherwise.
#
# DOCKER COMPOSE COMMAND REFERENCE
# --------------------------------------------------------------------------
# Start | docker-compose up -d
# Stop | docker-compose stop
# Update | docker-compose pull
# Logs | docker-compose logs --tail=25 -f
# Terminal | docker-compose exec photoprism bash
# Help | docker-compose exec photoprism photoprism help
# Config | docker-compose exec photoprism photoprism config
# Reset | docker-compose exec photoprism photoprism reset
# Backup | docker-compose exec photoprism photoprism backup -a -i
# Restore | docker-compose exec photoprism photoprism restore -a -i
# Index | docker-compose exec photoprism photoprism index
# Reindex | docker-compose exec photoprism photoprism index -f
# Import | docker-compose exec photoprism photoprism import
#
# To search originals for faces without a complete rescan:
# docker-compose exec photoprism photoprism faces index
#
# All commands may have to be prefixed with "sudo" when not running as root.
# This will point the home directory placeholder ~ to /root in volume mounts.
#
# More examples: https://docs.photoprism.org/getting-started/docker-compose/#command-line-interface
services:
## App Server (required)
photoprism:
## Use photoprism/photoprism:preview for testing preview builds:
image: photoprism/photoprism:latest
depends_on:
- mariadb
## Only enable automatic restarts once your installation is properly
## configured as it otherwise may get stuck in a restart loop,
## see https://docs.photoprism.org/getting-started/faq/#why-is-photoprism-getting-stuck-in-a-restart-loop
# restart: unless-stopped
security_opt:
- seccomp:unconfined
- apparmor:unconfined
## Run as a specific, non-root user (see https://docs.docker.com/engine/reference/run/#user):
# user: "1000:1000"
ports:
- "2342:2342" # HTTP port (host:container)
environment:
PHOTOPRISM_ADMIN_PASSWORD: "insecure" # PLEASE CHANGE: Your initial admin password (min 4 characters)
PHOTOPRISM_SITE_URL: "http://localhost:2342/" # Public server URL incl http:// or https:// and /path, :port is optional
PHOTOPRISM_ORIGINALS_LIMIT: 5000 # File size limit for originals in MB (increase for high-res video)
PHOTOPRISM_HTTP_COMPRESSION: "gzip" # Improves transfer speed and bandwidth utilization (none or gzip)
PHOTOPRISM_DEBUG: "false" # Run in debug mode (shows additional log messages)
PHOTOPRISM_PUBLIC: "false" # No authentication required (disables password protection)
PHOTOPRISM_READONLY: "false" # Don't modify originals directory (reduced functionality)
PHOTOPRISM_EXPERIMENTAL: "false" # Enables experimental features
PHOTOPRISM_DISABLE_CHOWN: "false" # Disables storage permission updates on startup
PHOTOPRISM_DISABLE_WEBDAV: "false" # Disables built-in WebDAV server
PHOTOPRISM_DISABLE_SETTINGS: "false" # Disables Settings in Web UI
PHOTOPRISM_DISABLE_TENSORFLOW: "false" # Disables all features depending on TensorFlow
PHOTOPRISM_DISABLE_FACES: "false" # Disables facial recognition
PHOTOPRISM_DISABLE_CLASSIFICATION: "false" # Disables image classification
PHOTOPRISM_DARKTABLE_PRESETS: "false" # Enables Darktable presets and disables concurrent RAW conversion
PHOTOPRISM_DETECT_NSFW: "false" # Flag photos as private that MAY be offensive (requires TensorFlow)
PHOTOPRISM_UPLOAD_NSFW: "true" # Allow uploads that MAY be offensive
# PHOTOPRISM_DATABASE_DRIVER: "sqlite" # SQLite is an embedded database that doesn't require a server
PHOTOPRISM_DATABASE_DRIVER: "mysql" # Use MariaDB 10.5+ or MySQL 8+ instead of SQLite for improved performance
PHOTOPRISM_DATABASE_SERVER: "mariadb:3306" # MariaDB or MySQL database server (hostname:port)
PHOTOPRISM_DATABASE_NAME: "photoprism" # MariaDB or MySQL database schema name
PHOTOPRISM_DATABASE_USER: "photoprism" # MariaDB or MySQL database user name
PHOTOPRISM_DATABASE_PASSWORD: "insecure" # MariaDB or MySQL database user password
PHOTOPRISM_SITE_TITLE: "PhotoPrism"
PHOTOPRISM_SITE_CAPTION: "Browse Your Life"
PHOTOPRISM_SITE_DESCRIPTION: ""
PHOTOPRISM_SITE_AUTHOR: ""
## Set a non-root user, group, or custom umask if your Docker environment doesn't support this natively:
# PHOTOPRISM_UID: 1000
# PHOTOPRISM_GID: 1000
# PHOTOPRISM_UMASK: 0000
## Enable TensorFlow AVX2 support for modern Intel CPUs (requires starting the container as root):
# PHOTOPRISM_INIT: "tensorflow-amd64-avx2"
## Hardware video transcoding config (optional):
# PHOTOPRISM_FFMPEG_BUFFERS: "64" # FFmpeg capture buffers (default: 32)
# PHOTOPRISM_FFMPEG_BITRATE: "32" # FFmpeg encoding bitrate limit in Mbit/s (default: 50)
# PHOTOPRISM_FFMPEG_ENCODER: "h264_v4l2m2m" # Use Video4Linux for AVC transcoding (default: libx264)
# PHOTOPRISM_FFMPEG_ENCODER: "h264_qsv" # Use Intel Quick Sync Video for AVC transcoding (default: libx264)
# PHOTOPRISM_INIT: "intel-graphics tensorflow-amd64-avx2" # Enable TensorFlow AVX2 & Intel Graphics support
HOME: "/photoprism"
## Hardware devices for video transcoding and machine learning (optional):
# devices:
# - "/dev/video11:/dev/video11" # Video4Linux (h264_v4l2m2m)
# - "/dev/dri/renderD128:/dev/dri/renderD128" # Intel GPU
# - "/dev/dri/card0:/dev/dri/card0"
working_dir: "/photoprism"
volumes:
## The *originals* folder contains your original photo and video files (- "[host folder]:/photoprism/originals"):
- "~/Pictures:/photoprism/originals"
## Multiple folders can be made accessible by mounting them as subfolders of /photoprism/originals:
# - "/mnt/Family:/photoprism/originals/Family" # [folder 1]:/photoprism/originals/[folder 1]
# - "/mnt/Friends:/photoprism/originals/Friends" # [folder 2]:/photoprism/originals/[folder 2]
## You may mount an *import* folder from which files can be transferred to *originals* (optional):
# - "~/Import:/photoprism/import"
## Cache, session, thumbnail, and sidecar files will be created in the *storage* folder (never remove):
- "./storage:/photoprism/storage"
## Database Server (recommended)
## see https://docs.photoprism.org/getting-started/faq/#should-i-use-sqlite-mariadb-or-mysql
mariadb:
restart: unless-stopped
image: mariadb:10.6
security_opt:
- seccomp:unconfined
- apparmor:unconfined
command: mysqld --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=120
volumes:
- "./database:/var/lib/mysql" # Never remove
environment:
MYSQL_ROOT_PASSWORD: insecure
MYSQL_DATABASE: photoprism
MYSQL_USER: photoprism
MYSQL_PASSWORD: insecure
## Watchtower upgrades services automatically (optional)
## see https://docs.photoprism.org/getting-started/updates/#watchtower
#
# watchtower:
# restart: unless-stopped
# image: containrrr/watchtower
# environment:
# WATCHTOWER_CLEANUP: "true"
# WATCHTOWER_POLL_INTERVAL: 7200 # Checks for updates every two hours
# volumes:
# - "/var/run/docker.sock:/var/run/docker.sock"
# - "~/.docker/config.json:/config.json" # Optional, for authentication if you have a Docker Hub account
Or deploy it directly from the source:
git clone https://github.com/xneo1/portainer_templates
cd portainer_templates
docker compose -f Template/Stack/photoprism.yml up -dMore install options in our documentation.
Container Documentation
photoprism Documentation
AI-Powered Photos App for the Decentralized Web 🌈💎✨
mariadb Documentation
MariaDB Server is a high performing open source relational database, forked from MySQL.
Serve Photoprism on your own domain behind Caddy, Nginx or Traefik. Fill in your domain and copy the result. It's a starting point, some apps need their own base URL or extra headers set too.
Proxying photoprism.example.com to http://photoprism:2342
Add this to your Caddyfile
photoprism.example.com {
reverse_proxy http://photoprism:2342
}Check the logs first
Nine times out of ten the logs tell you exactly what went wrong.
- In Portainer, go to Containers, click the container, then Logs. Or run
docker logs <container> - Exit codes help too:
137means killed, usually out of memory.126or127means the command inside the image is broken.
Port already in use
If deployment fails with "Bind for 0.0.0.0:2342 failed: port is already allocated", something else on your server is using that port.
- Find what's using it:
sudo ss -tlnp | grep :2342 - Stop the other service, or pick a different host port. In
2342:2342only the left number is yours to change, the right one belongs to the app.
Running but the page won't load
The container is up but nothing appears in your browser.
- Use your server's real IP:
http://your-server-ip:2342. The 0.0.0.0 link Portainer shows isn't a real address. - Give it a minute after first deploy, photoprism can take a while to initialise.
- Make sure your firewall allows the port, e.g.
sudo ufw allow 2342
Permission denied on volumes
If the logs show "permission denied", the app can't write to its data folder on the host.
- Fix the ownership:
sudo chown -R 1000:1000 ~/Pictures
Image won't pull
Test the pull directly on the host: docker pull photoprism/photoprism:latest
- "manifest unknown" means the tag no longer exists. This template uses
latest, so try pinning a specific version instead. - "toomanyrequests" is the Docker Hub rate limit. Log in with
docker loginto raise it. - "no space left on device" means a full disk. Reclaim space with
docker system prune
"exec format error"
This means the image was built for a different CPU architecture than your server.
- Check yours with
uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.
Container keeps restarting
The unless-stopped restart policy relaunches the app after every crash, so the real error can scroll past.
- Check the logs right after a restart, the last few lines before it died are the useful ones.
- Get the exit code with
docker inspect <container> --format '{{.State.ExitCode}}' - Still stuck? Redeploy once with the restart policy set to
noso the failure stays visible.
Required settings are blank
PHOTOPRISM_SITE_DESCRIPTION, PHOTOPRISM_SITE_AUTHOR have no default value, and photoprism may crash or misbehave if left empty.
- Fill them in on the deploy screen before hitting deploy.
Stack won't deploy
Compose stacks fail fast on small mistakes, and Portainer shows the reason just above the editor.
- YAML only accepts spaces for indentation, a single tab breaks the whole file.
- Relative volume paths like
./storageoften fail in Portainer because there's no working directory. Swap them for absolute paths.
Raise an issue
Found something which isn't working as it should? Here's how to report it.
- Bug within the app: Open an issue within photoprism's repo
- Template not working: Open an issue on xneo1/portainer_templates
- This website not working: Open an issue on lissy93/portainer-templates
A Compose stack
Photoprism is a Compose stack, a set of containers (2 of them) defined in one file and brought up together by Portainer, then started and stopped as a single app.
The services
This stack is built from 2 containers that run side by side. Here's each one, with the image it runs and anything it waits for first:
photoprismrunsphotoprism/photoprism:latest, starts after mariadbmariadbrunsmariadb:10.6
Ports
A port is the door the app answers on. A mapping like 2342:2342 means it's reachable on port 2342 of your server, where the left number is yours to change and the right one belongs to the app. It opens:
2342:2342
Volumes
A volume is where Photoprism keeps its files so they survive an update or a restart. Without one, anything it saves would sit inside the container and vanish the moment it's recreated. This template mounts:
/photoprism/originalsfrom~/Pictureson the host/photoprism/storagefrom./storageon the host/var/lib/mysqlfrom./databaseon the host
Environment variables
Environment variables are the settings you hand over when you deploy, things like a password or a timezone. Photoprism takes 31 of them, and 2 need a value before it'll start properly:
PHOTOPRISM_ADMIN_PASSWORD, defaults toinsecurePHOTOPRISM_SITE_URL, defaults tohttp://localhost:2342/PHOTOPRISM_ORIGINALS_LIMIT, defaults to5000PHOTOPRISM_HTTP_COMPRESSION, defaults togzipPHOTOPRISM_DEBUG, defaults tofalsePHOTOPRISM_PUBLIC, defaults tofalsePHOTOPRISM_READONLY, defaults tofalsePHOTOPRISM_EXPERIMENTAL, defaults tofalsePHOTOPRISM_DISABLE_CHOWN, defaults tofalsePHOTOPRISM_DISABLE_WEBDAV, defaults tofalsePHOTOPRISM_DISABLE_SETTINGS, defaults tofalsePHOTOPRISM_DISABLE_TENSORFLOW, defaults tofalsePHOTOPRISM_DISABLE_FACES, defaults tofalsePHOTOPRISM_DISABLE_CLASSIFICATION, defaults tofalsePHOTOPRISM_DARKTABLE_PRESETS, defaults tofalsePHOTOPRISM_DETECT_NSFW, defaults tofalsePHOTOPRISM_UPLOAD_NSFW, defaults totruePHOTOPRISM_DATABASE_DRIVER, defaults tomysqlPHOTOPRISM_DATABASE_SERVER, defaults tomariadb:3306PHOTOPRISM_DATABASE_NAME, defaults tophotoprismPHOTOPRISM_DATABASE_USER, defaults tophotoprismPHOTOPRISM_DATABASE_PASSWORD, defaults toinsecurePHOTOPRISM_SITE_TITLE, defaults toPhotoPrismPHOTOPRISM_SITE_CAPTION, defaults toBrowse Your LifePHOTOPRISM_SITE_DESCRIPTION, needs a valuePHOTOPRISM_SITE_AUTHOR, needs a valueHOME, defaults to/photoprismMYSQL_ROOT_PASSWORD, defaults toinsecureMYSQL_DATABASE, defaults tophotoprismMYSQL_USER, defaults tophotoprismMYSQL_PASSWORD, defaults toinsecure
Restart policy
The restart policy here is unless-stopped, so Docker restarts Photoprism after a crash or reboot, but leaves it off when you stop it on purpose. You can change this on the deploy screen. The choices are no (never restart), on-failure (only after a crash), unless-stopped (restart unless you stop it), and always (bring it back no matter what).
Networking
Portainer puts these services on one shared private network, so they can find each other by name (like photoprism) while only the ports above are open to you.
Platform
The platform is linux, the kind of system the container is built to run on. Docker and Portainer handle this on a normal Linux server.
Portainer app templates
Zooming out, this whole page comes from a Portainer app template: a short recipe telling Portainer how to set Photoprism up. Add the template list to Portainer once, then deploying Photoprism is a click rather than a wall of config.