PhotoPrism (AI-Powered Photo Manager) on Ubuntu 24.04

PhotoPrism is an open-source, self-hosted AI-powered photo and video management platform designed to organize, browse, and search large media libraries with ease. Using machine learning, PhotoPrism can automatically classify images, detect objects and scenes, recognize faces, and extract metadata, making your entire photo collection searchable and intelligently indexed.

Unlike cloud photo services, PhotoPrism gives you full ownership of your photos and videos. Everything runs on your own server, with no data sent to third parties — making it ideal for privacy-conscious users, photographers, and organizations.

Running PhotoPrism on Ubuntu 24.04 LTS (Noble Numbat) provides a modern, secure, and long-term supported foundation. Ubuntu 24.04 includes OpenSSL 3, systemd 255, and excellent Docker support, making it a solid platform for deploying PhotoPrism with Docker, PostgreSQL, Nginx, and HTTPS in a production-ready setup.


Architecture Overview

LayerComponentRole
OSUbuntu 24.04 LTSStable, long-term supported Linux base
Container RuntimeDocker / Docker ComposeRuns PhotoPrism and supporting services
ApplicationPhotoPrism (Go + TensorFlow Lite)AI-powered photo and video management
DatabasePostgreSQLStores metadata, indexes, and search data
StorageLocal filesystem / NASOriginal photos and videos
Reverse ProxyNginxHTTPS termination, routing, compression
TLSLet’s Encrypt / PKISecure web access to the PhotoPrism UI

PhotoPrism uses a resource-efficient AI pipeline and can scale from small personal libraries to hundreds of thousands of photos.


Why Use PhotoPrism?

  • AI-powered search – find photos by objects, scenes, places, and keywords
  • Face recognition – group photos by people automatically
  • Privacy-first – fully self-hosted, no cloud dependency
  • Modern web interface – fast, responsive, and mobile-friendly
  • Powerful metadata handling – EXIF, GPS, camera data, RAW support
  • Video support – manage and preview videos alongside photos
  • Multi-user support – shared libraries with access control
  • Open-source & extensible – active development and plugins

PhotoPrism is designed for users who want Google Photos-like features without sacrificing privacy or control.


PhotoPrism vs Other Photo Management Solutions

Feature / CapabilityPhotoPrismGoogle PhotosNextcloud PhotosPiwigo
HostingSelf-hostedCloud onlySelf-hosted / CloudSelf-hosted
AI search✅ Yes✅ Yes❌ No❌ Limited
Face recognition✅ Yes✅ Yes❌ No❌ No
PrivacyFull controlGoogle-controlledPartialFull
RAW support✅ YesLimitedLimitedLimited
CostFree / Open-sourceFree / PaidFree / PaidFree / Paid

PhotoPrism is ideal for users who want advanced AI features with full data ownership.


Security & Best Practices on Ubuntu 24.04

  • Run PhotoPrism behind Nginx with HTTPS enabled.
  • Keep PhotoPrism and PostgreSQL on internal Docker networks only.
  • Store secrets (DB passwords, admin credentials) using environment variables.
  • Enable UFW and allow only ports 80 and 443.
  • Automate SSL certificate renewal using Certbot.
  • Regularly update Ubuntu, Docker, and PhotoPrism images.
  • Back up:
    • original photos/videos
    • PostgreSQL database
    • PhotoPrism configuration and index
  • Use read-only mounts for original photo directories when possible.
  • Limit admin access and create separate user roles.

Typical Use Cases

  • Personal photo libraries – replace Google Photos or iCloud Photos
  • Family media servers – shared albums with private hosting
  • Photographers – manage large RAW and JPEG collections
  • Home labs & NAS setups – centralized photo management
  • Privacy-focused users – AI features without cloud tracking
  • Small organizations – internal photo archives and media catalogs

Deploying PhotoPrism on Ubuntu 24.04 with Docker, PostgreSQL, Nginx, and SSL gives you a powerful, AI-driven photo management platform — combining modern machine learning features with complete data ownership, privacy, and long-term reliability.


Create an Ubuntu 24.04 Instance on Shape.Host

Go to https://shape.host and log in

Click Create

Choose Instance

Shape.host Resources dashboard with Create > Instance highlighted.

Select a server location

Shape.host instance form with the data center location selector highlighted.

Choose Ubuntu 24.04 (64-bit)

Pick a plan (recommended minimum for PhotoPrism):

2 vCPU

4 GB RAM (8 GB recommended for AI indexing)

40 GB NVMe SSD (or more, depending on photo library size)

Shape.host instance form with the operating system image selector highlighted.

Click Create Instance

Wait for provisioning

Shape.host instance form with the Create Instance button highlighted.

Copy the public IP address

Shape.host Resources dashboard with the server IP address highlighted.

Step 1: Connect to the Server via SSH

From your local machine:

ssh root@YOUR_SERVER_IP

You are now logged in as the root user.


Step 2: Update the System

apt update
apt upgrade -y

Updates all installed packages and applies security patches.

Terminal showing APT package management commands and output.

Step 3: Install Required System Packages

apt install ca-certificates curl gnupg lsb-release

These packages are required to securely add external repositories.

Terminal showing APT package management commands and output.

Step 4: Create Docker Keyrings Directory

mkdir -p /etc/apt/keyrings

This directory stores trusted GPG keys for external repositories.


Step 5: Add Docker GPG Key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg

Ensures Docker packages are verified and trusted.


Step 6: Add Docker Repository

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg]
https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list

Adds the official Docker package source.


Step 7: Update Package Index

apt update

Loads packages from the Docker repository.

Terminal showing APT package management commands and output.

Step 8: Install Docker and Docker Compose

apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Installs Docker Engine and Docker Compose v2.

Terminal showing APT package management commands and output.

Step 9: Verify Docker Installation

docker --version
docker compose version

Confirms Docker and Docker Compose are installed correctly.

Terminal showing the installed Docker Compose version.

Step 10: Create PhotoPrism Directory

mkdir -p /opt/photoprism
cd /opt/photoprism

This directory will store configuration, originals, and index data.


Step 11: Download PhotoPrism Docker Compose File

wget https://dl.photoprism.app/docker/compose.yaml -O docker-compose.yml

Downloads the official PhotoPrism Docker Compose template.

Terminal showing file download commands and transfer output.

Step 12: Edit Docker Compose Configuration

nano docker-compose.yml

Adjust the configuration to match your setup:

services:
  photoprism:
    image: photoprism/photoprism:latest
    restart: unless-stopped
    ports:
      - "2342:2342"
    environment:
      PHOTOPRISM_ADMIN_PASSWORD: "StrongAdminPasswordHere"
      PHOTOPRISM_ORIGINALS_PATH: "/photoprism/originals"
      PHOTOPRISM_STORAGE_PATH: "/photoprism/storage"
    volumes:
      - /opt/photoprism/originals:/photoprism/originals
      - /opt/photoprism/storage:/photoprism/storage

Explanation:

  • Admin password secures the web interface
  • Originals store your photos
  • Storage holds thumbnails, indexes, and metadata

Save and exit the file.


Step 13: Create Required Directories

mkdir -p /opt/photoprism/originals
mkdir -p /opt/photoprism/storage

These directories will persist your photos and PhotoPrism data.

Terminal showing file and directory setup commands.

Step 14: Pull PhotoPrism Image

docker compose pull

Downloads the latest PhotoPrism Docker image.

Terminal showing container image download progress.

Step 15: Start PhotoPrism

docker compose up -d

Starts PhotoPrism in the background.

Terminal showing container image download progress.

Step 16: Verify Running Containers

docker compose ps

Ensures PhotoPrism container is running.

Terminal showing file and directory setup commands.

Step 17: Install Nginx

apt install nginx

Nginx will act as a reverse proxy.

Terminal showing APT package management commands and output.

Step 18: Create Nginx Configuration

nano /etc/nginx/sites-available/photoprism

Paste the following configuration:

server {
    listen 80;
    server_name photos.example.com;

    client_max_body_size 500M;

    location / {
        proxy_pass http://127.0.0.1:2342;
        proxy_http_version 1.1;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_buffering off;
    }
}

Explanation:

  • Allows large photo uploads
  • Supports WebSockets
  • Proxies traffic securely to PhotoPrism
Terminal showing web server configuration text.

Step 19: Enable Nginx Site

ln -s /etc/nginx/sites-available/photoprism /etc/nginx/sites-enabled/
rm /etc/nginx/sites-enabled/default

Step 20: Test and Reload Nginx

nginx -t
systemctl reload nginx
Terminal showing an Apache configuration test.

Step 21: Install SSL Certificate

apt install certbot python3-certbot-nginx
certbot --nginx -d ubuntu-tutorials.shape.host

Certbot automatically configures HTTPS.

Terminal showing APT package management commands and output.
Terminal showing Certbot certificate commands and messages.

https://yourdomain.com

Login using the admin password set in the Docker Compose file.

PhotoPrism sign-in form.
PhotoPrism photo library with an empty results area.

Run PhotoPrism on Shape.Host

PhotoPrism benefits from fast NVMe storage and strong CPU performance, especially during AI indexing.

Shape.Host Cloud VPS offers:

  • NVMe SSD storage
  • Instant Ubuntu 24.04 deployments
  • Clean OS images
  • Stable networking
  • Excellent performance for Docker workloads

Deploy your next self-hosted media stack at https://shape.host.