PhotoPrism logo

PhotoPrism

AI-powered, privacy-first app for browsing, organizing, and sharing photos and videos

Alternative to: google photos, apple photos, amazon photos


PhotoPrism is an AI-powered, privacy-first application for browsing, organizing, and sharing your photo and video collection. It automatically labels pictures based on their content and location, recognizes faces, and provides powerful search filters so you can quickly find specific photos and videos. It runs self-hosted via Docker on your own hardware, so your library never has to leave your control.

PhotoPrism Docker Compose example

Self-host PhotoPrism on your own server, homelab, or VPS starting from this Docker Compose example. It runs PhotoPrism in Docker containers using the official photoprism/photoprism:latest, mariadb:11 images, with persistent volumes and automatic restarts preconfigured. Review the environment variables and adjust them to your setup, save the file as compose.yml (or docker-compose.yml), and start the stack with docker compose up -d.

services:
  photoprism:
    image: photoprism/photoprism:latest
    restart: unless-stopped
    stop_grace_period: 15s
    depends_on:
      - mariadb
    security_opt:
      - seccomp:unconfined
      - apparmor:unconfined
    working_dir: "/photoprism"
    volumes:
      - originals:/photoprism/originals
      - storage:/photoprism/storage
    environment:
      # Admin login username for the web UI.
      PHOTOPRISM_ADMIN_USER: "admin"
      # Initial admin password (8-72 characters), only applied on first start.
      PHOTOPRISM_ADMIN_PASSWORD: "changeme"
      # Authentication mode: "password" (default) or "public" (no login).
      PHOTOPRISM_AUTH_MODE: "password"
      # Disable built-in HTTPS/TLS so PhotoPrism serves plain HTTP on 2342 behind a TLS-terminating reverse proxy.
      PHOTOPRISM_DISABLE_TLS: "true"
      # Do not generate a self-signed certificate (TLS is terminated upstream).
      PHOTOPRISM_DEFAULT_TLS: "false"
      # Default user interface language, e.g. "en" or "de".
      PHOTOPRISM_DEFAULT_LOCALE: "en"
      # Public URL where PhotoPrism is reached, in the form "http(s)://domain.name(:port)/(path)".
      PHOTOPRISM_SITE_URL: "http://localhost:2342/"
      # Main title shown in the web interface and meta tags.
      PHOTOPRISM_SITE_TITLE: "PhotoPrism"
      # Short caption or tagline shown alongside the title.
      PHOTOPRISM_SITE_CAPTION: "AI-Powered Photos App"
      # Log level: trace, debug, info, warning, or error.
      PHOTOPRISM_LOG_LEVEL: "info"
      # Maximum size of original media files in MB (larger files are skipped).
      PHOTOPRISM_ORIGINALS_LIMIT: "5000"
      # Response compression: none, gzip, zstd, or a comma-separated list.
      PHOTOPRISM_HTTP_COMPRESSION: "zstd,gzip"
      # Database driver: "mysql" for the bundled MariaDB service (recommended over sqlite).
      PHOTOPRISM_DATABASE_DRIVER: "mysql"
      # MariaDB database server (hostname:port), must match the mariadb service.
      PHOTOPRISM_DATABASE_SERVER: "mariadb:3306"
      # MariaDB database name, must match MARIADB_DATABASE.
      PHOTOPRISM_DATABASE_NAME: "photoprism"
      # MariaDB username, must match MARIADB_USER.
      PHOTOPRISM_DATABASE_USER: "photoprism"
      # MariaDB password (database is only reachable inside this compose network), must match MARIADB_PASSWORD.
      PHOTOPRISM_DATABASE_PASSWORD: "photoprism"

  mariadb:
    image: mariadb:11
    restart: unless-stopped
    stop_grace_period: 15s
    security_opt:
      - seccomp:unconfined
      - apparmor:unconfined
    command: --innodb-buffer-pool-size=512M --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:
      - db_data:/var/lib/mysql
    environment:
      # Automatically upgrade the data directory after a MariaDB image update.
      MARIADB_AUTO_UPGRADE: "1"
      # Skip loading timezone info on init (faster startup).
      MARIADB_INITDB_SKIP_TZINFO: "1"
      # Database created on first start; must match PHOTOPRISM_DATABASE_NAME.
      MARIADB_DATABASE: "photoprism"
      # Database user created on first start; must match PHOTOPRISM_DATABASE_USER.
      MARIADB_USER: "photoprism"
      # Password for the database user; must match PHOTOPRISM_DATABASE_PASSWORD.
      MARIADB_PASSWORD: "photoprism"
      # Root password (only reachable inside this compose network).
      MARIADB_ROOT_PASSWORD: "photoprism"

volumes:
  originals:
  storage:
  db_data:

Values set to changeme are required — replace them with your own values before starting PhotoPrism.

Prefer a managed setup? WinterFlow installs, configures, and updates PhotoPrism for you using this same Docker Compose configuration.