How to Set Up PhotoPrism with Azure Files Storage for Your Photo Management Needs

If you’ve been following my blog, you know I love combining self-hosted media applications with Azure Files for scalable, cloud-backed storage. After setting up Jellyfin for videos and Navidrome for music, it’s time to tackle photo management with PhotoPrism, a powerful, open-source solution for organizing and accessing your photo library.

In this guide, I’ll show you how to deploy PhotoPrism using Docker Compose while storing all your photos and metadata in Azure Files, just like we did with Syncthing, Jellyfin, and Navidrome.


Why PhotoPrism with Azure Files?

PhotoPrism is an excellent alternative to Google Photos, offering:

  • AI-powered facial recognition
  • Advanced search (by location, objects, date)
  • Metadata extraction and organization
  • Web and mobile-friendly interface

By using Azure Files, you get:

  • Scalable storage (pay only for what you use)
  • Redundancy and backups (via Azure snapshots)
  • Seamless mounting on Linux (as we did before)

Prerequisites

Before we begin, make sure you have:

  1. Azure Files set up (follow my previous guide)
  2. Docker & Docker Compose installed (same as in my Jellyfin setup)
  3. A Linux server (I’m using Ubuntu, but this works on any distro)

Step 1: Mount Azure Files for PhotoPrism

First, mount your Azure Files share where PhotoPrism will store photos and metadata:

sudo mkdir -p /mnt/azurephotoprism  
sudo mount -t cifs //<storage-account>.file.core.windows.net/<share-name> /mnt/azurephotoprism \
-o vers=3.0,username=<storage-account>,password=<access-key>,dir_mode=0777,file_mode=0777,serverino

To make this permanent, add it to /etc/fstab (as covered in my Azure Files mounting guide).


Step 2: Prepare the Directory Structure

PhotoPrism needs three main directories:

  • Storage (where your organized photos live)
  • Import (where new photos are initially uploaded)
  • Database (MariaDB data for metadata)

Run:

mkdir -p /mnt/azurephotoprism/photoprism/{storage,import,database}

Step 3: Set Up Docker Compose

Instead of using the default compose.yaml from PhotoPrism’s site, we’ll customize it for Azure Files storage.

Create a docker-compose.yml file:

version: '3.5'

services:
  photoprism:
    image: photoprism/photoprism:latest
    container_name: AzureFilesPhotoprism
    depends_on:
      - mariadb
    ports:
      - "2342:2342"
    environment:
      PHOTOPRISM_ADMIN_PASSWORD: "ChangeThisPassword!"
      PHOTOPRISM_STORAGE_PATH: "/photoprism/storage"
      PHOTOPRISM_IMPORT_PATH: "/photoprism/import"
      PHOTOPRISM_EXCLUDE: "cache,thumbnails,*temp*"
    volumes:
      - "/mnt/azurephotoprism/photoprism/storage:/photoprism/storage"
      - "/mnt/azurephotoprism/photoprism/import:/photoprism/import"

  mariadb:
    image: mariadb:10.6
    container_name: photoprism-mariadb
    volumes:
      - "/mnt/azurephotoprism/photoprism/database:/var/lib/mysql"
    environment:
      MYSQL_ROOT_PASSWORD: "insecure"
      MYSQL_DATABASE: photoprism
      MYSQL_USER: photoprism
      MYSQL_PASSWORD: "insecure"

Step 4: Launch PhotoPrism

Run:

docker-compose up -d

Wait a few minutes, then access PhotoPrism at: http://your-server-ip:2342

Log in with:

  • Username: admin
  • Password: What you set in PHOTOPRISMADMINPASSWORD

Step 5: Configure PhotoPrism for Azure Files

  1. Set up storage paths in Settings → Library.
  2. Start importing photos (either via upload or pointing to existing folders).
  3. Enable AI features (face recognition, object detection).

Performance Tips for Azure Files

Since Azure Files can have latency, consider:

  • Enable local caching for frequently accessed thumbnails
  • Schedule indexing during off-peak hours
  • Use Premium File Shares if performance is critical

Backup & Snapshots

Just like in my Syncthing guide, use Azure snapshots:

az storage share snapshot --name <share-name> --account-name <storage-account>

Final Thoughts

Now you have a fully cloud-backed PhotoPrism setup with Azure Files, just like we did with Jellyfin and Navidrome. This gives you:

  • Unlimited photo storage (scaled via Azure)
  • AI-powered organization (without vendor lock-in)
  • Self-hosted privacy (no Google/Apple)

If you run into issues, check my previous guides or drop a comment below!


Next steps?

  • Sync your photos automatically with Syncthing + Azure Files: https://fadyanwar.com/index.php/2025/05/21/setting-up-syncthing-with-azure-files/
  • Stream videos with Jellyfin on Azure: https://fadyanwar.com/index.php/2025/06/04/setting-up-jellyfin-to-stream-your-azure-backed-media-collection/

Happy self-hosting! 🚀



Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *