English
Get started

← All templates · Media

Deploy PhotoPrism in one click

An AI-powered photo library: browse, search, map and share your photos and videos

A self-hosted alternative to Google Photos and Apple Photos.

What is PhotoPrism?

PhotoPrism is a web app for a photo and video library. It reads each file’s date, camera and location, labels what a picture shows, finds faces and groups them into people, and spots duplicates. The library opens by search, albums, moments, a calendar, a world map of places, people, labels and folders, and it takes RAW files, videos and Live Photos. It installs on a phone as a progressive web app, and serves its originals over WebDAV, so apps such as PhotoSync upload a phone’s camera roll by themselves.

People self-host PhotoPrism to keep their photos off Google Photos and iCloud. This template runs the free Community edition with MariaDB, its photos and thumbnails in volumes, and makes the admin from the fields before PhotoPrism answers anyone. The catch: more user accounts are added from the command line, since the user management screen, more roles and 3D maps are in its paid memberships, and there are no native phone apps.

Hosting PhotoPrism on Pethost

  1. You sign in to Pethost with a passkey, GitHub or Google. No machine yet? You pick a plan, and the link waits until it is ready.
  2. New project opens at PhotoPrism. You fill in what it asks for and click Create project: Username, Admin password.
  3. In a minute or two PhotoPrism is live at its own address with HTTPS. Its secrets are made at random, and its data is in the nightly backup.
  4. It is a project like any other: you or your agent can change it, roll it back or restore it.

Questions about PhotoPrism

Is PhotoPrism free?

Yes. The Community edition is open source under the AGPL-3.0 and free. The Essentials membership, from €2 a month billed yearly, adds more user roles and better maps, and Plus, from €6 a month, adds a user management screen.

PhotoPrism or Immich?

Both are self-hosted photo libraries with face recognition and maps. Immich comes with native apps that back up a phone, while PhotoPrism is a web app that phones sync with over WebDAV.

Does PhotoPrism recognize faces?

Yes. It detects faces as it indexes, groups those of the same person, and once you name a group in People, finds that person in the rest of the library.

How do I upload photos from my phone to PhotoPrism?

Open it in the phone’s browser and upload, or sync over WebDAV with an app such as PhotoSync, using the address and the account shown in Settings → Account → Connect via WebDAV.

How do I add users to PhotoPrism?

In the Community edition, from the command line: photoprism users add with a username, a role and a password, run in the photoprism service’s shell. The user management screen is part of the paid Plus membership.

How much memory and disk does PhotoPrism need?

PhotoPrism takes about 300 MB of memory with MariaDB at rest, and about 550 MB while it imports; the disk holds the photos at their own size, plus thumbnails. On Pethost the Starter plan is enough for it, with room for other apps beside it.

PhotoPrism Docker Compose file

The template is this compose.yaml and the variables written into the project’s .env as it is created. Pethost runs the file as it is written.

Containers: photoprism (photoprism/photoprism:261007), mariadb (mariadb:11.8).

Volumes, in the nightly backup: originals, storage, db.

services:
  photoprism:
    image: photoprism/photoprism:261007
    restart: unless-stopped
    stop_grace_period: 15s
    working_dir: /photoprism
    environment:
      PHOTOPRISM_SITE_URL: ${URL}/
      # The administrator is made from these at the first start, before PhotoPrism answers anyone;
      # every page and photo asks to sign in. Later the password is changed in PhotoPrism.
      PHOTOPRISM_AUTH_MODE: password
      PHOTOPRISM_ADMIN_USER: ${ADMIN_USERNAME}
      PHOTOPRISM_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
      # The proxy serves HTTPS; requests come from it over the project's network.
      PHOTOPRISM_DISABLE_TLS: "true"
      PHOTOPRISM_DEFAULT_TLS: "false"
      PHOTOPRISM_TRUSTED_PROXY: 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
      PHOTOPRISM_DATABASE_DRIVER: mysql
      PHOTOPRISM_DATABASE_SERVER: mariadb:3306
      PHOTOPRISM_DATABASE_NAME: photoprism
      PHOTOPRISM_DATABASE_USER: photoprism
      PHOTOPRISM_DATABASE_PASSWORD: ${MARIADB_PASSWORD}
      PHOTOPRISM_SIDECAR_YAML: "true"
      PHOTOPRISM_BACKUP_ALBUMS: "true"
      PHOTOPRISM_BACKUP_DATABASE: "true"
      PHOTOPRISM_BACKUP_SCHEDULE: daily
      PHOTOPRISM_UPLOAD_NSFW: "true"
    volumes:
      # The photos and videos as they were uploaded.
      - originals:/photoprism/originals
      # The index's thumbnails, sidecar files and backups.
      - storage:/photoprism/storage
    depends_on:
      mariadb:
        condition: service_healthy

  mariadb:
    image: mariadb:11.8
    restart: unless-stopped
    stop_grace_period: 15s
    command: --innodb-buffer-pool-size=256M --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
    environment:
      MARIADB_AUTO_UPGRADE: "1"
      MARIADB_INITDB_SKIP_TZINFO: "1"
      MARIADB_DATABASE: photoprism
      MARIADB_USER: photoprism
      MARIADB_PASSWORD: ${MARIADB_PASSWORD}
      MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
    volumes:
      - db:/var/lib/mysql
    healthcheck:
      test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
      interval: 5s
      timeout: 5s
      retries: 10
      start_period: 30s

volumes:
  originals:
  storage:
  db:

More in Media