← All articles
PHOTOS PhotoPrism: AI-Powered Photo Management You Can Self... 2026-02-09 · photoprism · photos · ai

PhotoPrism: AI-Powered Photo Management You Can Self-Host

Photos 2026-02-09 photoprism photos ai face-recognition machine-learning self-hosted

You have years of photos scattered across hard drives, phone backups, and cloud services. You want something that organizes them, finds faces, tags objects, and lets you browse by location — without uploading everything to Google.

PhotoPrism is a self-hosted photo management application powered by machine learning. It automatically classifies your photos, recognizes faces, detects objects and scenes, reads GPS data, and makes everything searchable through a clean web interface.

What PhotoPrism Does

PhotoPrism vs. Immich

These are the two leading self-hosted photo platforms, but they serve different use cases:

Feature PhotoPrism Immich
Primary strength Organization & AI tagging Mobile backup & sharing
Mobile app PWA (no native app) Native iOS + Android apps
Auto backup from phone Via WebDAV or sync tools Built-in, automatic
Face recognition Yes Yes
Object/scene detection Yes (TensorFlow) Yes (CLIP-based)
RAW support Excellent Good
Video transcoding Yes (FFmpeg) Yes (FFmpeg)
Shared albums Yes Yes
Partner sharing No Yes
External library indexing Yes (primary workflow) Yes
Map view Yes Yes
Live photos Yes Yes
Maturity Stable, slower release cycle Fast-moving, breaking changes
Resource usage Moderate (400-800 MB) Moderate-high (500 MB-1 GB+)

When to choose PhotoPrism

When to choose Immich

Both are good. They are different tools for different workflows.

Hardware Requirements

PhotoPrism's ML features need real hardware. Plan accordingly:

Library Size RAM CPU Storage Initial Indexing Time
< 10,000 photos 4 GB 2 cores 100 GB 1-3 hours
10,000 - 50,000 4-8 GB 4 cores 500 GB 6-12 hours
50,000 - 200,000 8-16 GB 4-8 cores 1-4 TB 1-3 days
200,000+ 16+ GB 8+ cores 4+ TB Days

Key considerations:

Can you run it on a Raspberry Pi?

Technically yes, but barely. ARM64 builds exist, but TensorFlow on a Pi 4 is painfully slow. Indexing a library of 10,000 photos could take a week. A Pi 5 with 8 GB is better but still not great. An old x86 desktop or a small NUC is a much better experience.

Docker Compose Setup

services:
  photoprism:
    image: photoprism/photoprism:latest
    restart: unless-stopped
    security_opt:
      - seccomp:unconfined
      - apparmor:unconfined
    ports:
      - "2342:2342"
    environment:
      PHOTOPRISM_ADMIN_USER: "admin"
      PHOTOPRISM_ADMIN_PASSWORD: "change-me-immediately"
      PHOTOPRISM_AUTH_MODE: "password"
      PHOTOPRISM_SITE_URL: "https://photos.yourdomain.com/"
      PHOTOPRISM_ORIGINALS_LIMIT: 5000        # Max file size in MB
      PHOTOPRISM_HTTP_COMPRESSION: "gzip"
      PHOTOPRISM_DATABASE_DRIVER: "mysql"
      PHOTOPRISM_DATABASE_SERVER: "photoprism-db:3306"
      PHOTOPRISM_DATABASE_NAME: "photoprism"
      PHOTOPRISM_DATABASE_USER: "photoprism"
      PHOTOPRISM_DATABASE_PASSWORD: "${DB_PASSWORD}"
      PHOTOPRISM_DETECT_NSFW: "true"
      PHOTOPRISM_UPLOAD_NSFW: "true"
      PHOTOPRISM_RAW_PRESETS: "false"          # Use embedded JPEG for RAW preview (faster)
    volumes:
      - /mnt/photos/originals:/photoprism/originals
      - /mnt/photos/import:/photoprism/import
      - photoprism_storage:/photoprism/storage
    depends_on:
      photoprism-db:
        condition: service_healthy

  photoprism-db:
    image: mariadb:11
    restart: unless-stopped
    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:
      - photoprism_db:/var/lib/mysql
    environment:
      MARIADB_AUTO_UPGRADE: "1"
      MARIADB_INITDB_SKIP_TZINFO: "1"
      MARIADB_DATABASE: "photoprism"
      MARIADB_USER: "photoprism"
      MARIADB_PASSWORD: "${DB_PASSWORD}"
      MARIADB_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
    healthcheck:
      test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
      interval: 10s
      timeout: 5s
      retries: 5

volumes:
  photoprism_storage:
  photoprism_db:

Create a .env file:

DB_PASSWORD=$(openssl rand -base64 24)
DB_ROOT_PASSWORD=$(openssl rand -base64 24)

Why MariaDB?

PhotoPrism strongly recommends MariaDB over SQLite. SQLite works for small libraries but causes performance issues and locking errors once you get past a few thousand photos. PostgreSQL is not supported — it is MariaDB or SQLite only.

Storage Layout

Understanding how PhotoPrism organizes files is important:

/photoprism/originals/     # Your actual photos (read-only recommended)
/photoprism/import/        # Staging area for new photos
/photoprism/storage/       # App data: thumbnails, sidecar files, config
  ├── cache/               # Thumbnail cache (can be large)
  ├── sidecar/             # JSON metadata, YAML files
  └── config/              # App configuration

The key workflow:

  1. Originals: Mount your existing photo library here. PhotoPrism indexes it in place and never modifies your original files.
  2. Import: Drop new photos here. PhotoPrism moves them into the originals folder with configurable naming (by date, camera, etc.).
  3. Storage: Contains generated thumbnails, sidecar metadata files, and the search index. This is PhotoPrism's working data.

Storage math

For a 100,000 photo library with an average of 5 MB per photo:

Plan for originals + 20-25% for PhotoPrism's working data.

Face Recognition Setup

Face recognition is enabled by default. After indexing:

  1. Go to People in the sidebar
  2. You will see clusters of detected faces
  3. Click a face cluster and assign a name
  4. PhotoPrism merges clusters that you name the same

Face recognition tips

RAW File Handling

PhotoPrism has excellent RAW support through a combination of tools:

By default, PhotoPrism uses the embedded JPEG preview in RAW files for fast browsing. Set PHOTOPRISM_RAW_PRESETS: "true" to use Darktable for higher quality conversions, but this significantly increases indexing time.

To enable Darktable:

environment:
  PHOTOPRISM_DARKTABLE_PRESETS: "true"

Darktable is included in the PhotoPrism Docker image — you do not need to install it separately.

Mobile Access

PhotoPrism does not have a native mobile app. Instead it offers a Progressive Web App (PWA):

  1. Open PhotoPrism in your mobile browser
  2. Tap "Add to Home Screen"
  3. It works like a native app with offline caching

For automatic phone backup, you have a few options:

None of these are as seamless as Immich's native app. This is PhotoPrism's biggest weakness compared to Immich for phone-centric users.

Performance Tuning

Thumbnail pre-generation

By default, PhotoPrism generates thumbnails on demand. For large libraries, pre-generate them:

docker exec photoprism photoprism thumbs

This prevents slow first-load times when browsing.

Database tuning

The MariaDB --innodb-buffer-pool-size in the Compose file above is set to 512 MB. Adjust based on your available RAM:

Disabling features you don't need

If resources are tight, disable ML features you don't use:

environment:
  PHOTOPRISM_DISABLE_FACES: "true"       # Disable face recognition
  PHOTOPRISM_DISABLE_CLASSIFICATION: "true"  # Disable object/scene detection
  PHOTOPRISM_DISABLE_VECTORS: "true"     # Disable vector graphics support

Multi-User Setup

PhotoPrism supports multiple users with different roles:

Create users via Settings → Users or the command line:

docker exec photoprism photoprism users add -p "password" -r user username

Each user can have different access to originals folders, which is useful for shared family libraries where some folders should be private.

Honest Limitations

Backup Strategy

  1. Originals: These are your actual photos. Back them up with your normal backup strategy (rsync, Borg, Restic).
  2. Database: docker exec photoprism-db mariadb-dump -u photoprism -p photoprism > photoprism-db.sql
  3. Storage volume: Contains thumbnails and sidecar files. Thumbnails can be regenerated, but sidecar files contain your edits and metadata changes.

The originals are irreplaceable. The database and sidecar files contain your organizational work (names, albums, labels). The thumbnails can be regenerated.

The Bottom Line

PhotoPrism is the right choice if your primary workflow is organizing and browsing a large existing photo library on a computer. Its AI features genuinely help — automatic labeling, face recognition, and location mapping turn a pile of files into a searchable, browsable collection.

If your main need is automatic phone backup with a Google Photos-like mobile experience, Immich is the better fit. But if you're a photographer with terabytes of RAW files on a NAS, or someone who wants powerful search and organization for an existing library, PhotoPrism delivers.

Resources