Full PhotoPrism Setup Guide on Raspberry Pi (or Linux Server)
TL;DR
A complete, step-by-step guide to self-hosting the PhotoPrism photo library on a Raspberry Pi 4 or Linux server: install Docker and Compose, mount an external drive, write the Compose configuration, start PhotoPrism, set it to launch on boot, index your photos and optionally enable remote access.
On this page
Complete Guide: Setting Up PhotoPrism on Raspberry Pi with External Drive

1. Prepare Your Raspberry Pi
- Use Raspberry Pi 4 (2GB+ RAM) or similar Linux device
- Install Raspberry Pi OS (64-bit recommended) and update system:
sudo apt update && sudo apt upgrade -y
- Ensure internet connection and SSH access if remote
2. Install Docker
- Download and install Docker with the official script:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
- Add your user to the docker group (replace
piwith your username):
sudo usermod -aG docker pi
- Log out and back in or reboot for group changes to apply
- Verify Docker installation:
docker --version
3. Install Docker Compose Plugin
- Download and install the Docker Compose plugin for ARM64:
sudo mkdir -p /usr/lib/docker/cli-plugins/
sudo curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-aarch64 -o /usr/lib/docker/cli-plugins/docker-compose
sudo chmod +x /usr/lib/docker/cli-plugins/docker-compose
- Verify installation:
docker compose version
4. Mount and Prepare External Hard Drive
- Connect your external SSD/HDD to the Raspberry Pi
- Identify mount point (example:
/media/pi/myssd) or mount manually - To auto-mount on boot, edit
/etc/fstabaccordingly (optional) - Create folders for PhotoPrism data on the mounted drive:
mkdir -p /media/pi/myssd/photoprism/originals
mkdir -p /media/pi/myssd/photoprism/storage
- Set permissions for Docker to access:
sudo chown -R pi:pi /media/pi/myssd/photoprism
sudo chmod -R 755 /media/pi/myssd/photoprism
5. Create Docker Compose Configuration
- Create and edit
docker-compose.ymlin a directory, e.g.~/photoprism/:
nano ~/photoprism/docker-compose.yml
- Paste this configuration (update password and paths accordingly):
version: "3.8"
services:
photoprism:
image: photoprism/photoprism:latest
container_name: photoprism
restart: unless-stopped
ports:
- "2342:2342"
environment:
PHOTOPRISM_ADMIN_PASSWORD: "yourpassword"
PHOTOPRISM_SITE_URL: "http://localhost:2342/"
PHOTOPRISM_ORIGINALS_LIMIT: 500000
PHOTOPRISM_DISABLE_TLS: "true"
volumes:
- /media/pi/myssd/photoprism/originals:/photoprism/originals
- /media/pi/myssd/photoprism/storage:/photoprism/storage
6. Start PhotoPrism
- Navigate to your compose folder and launch PhotoPrism container:
cd ~/photoprism
docker compose up -d
- Check running containers:
docker ps
7. Access PhotoPrism Web Interface
- Find your Raspberry Pi’s local IP address:
hostname -I
- On any device connected to the same network (phone, PC), open a browser and visit:
http://<Raspberry_Pi_IP>:2342
- Log in with username
adminand the password you set
8. Configure PhotoPrism to Start Automatically on Boot
- Create a systemd service file:
sudo nano /etc/systemd/system/photoprism.service
- Paste the following:
[Unit]
Description=PhotoPrism Container
Requires=docker.service
After=docker.service
[Service]
Restart=always
WorkingDirectory=/home/pi/photoprism
ExecStart=/usr/bin/docker compose up
ExecStop=/usr/bin/docker compose down
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target
- Enable and start the service:
sudo systemctl enable photoprism.service
sudo systemctl start photoprism.service
- Check status:
sudo systemctl status photoprism.service
9. Upload and Index Your Photos
- Copy photos to
/media/pi/myssd/photoprism/originalsvia USB, SCP, SMB, or other methods - In the PhotoPrism web UI, go to Library → Index to scan and process the photos
10. Optional: Remote Access Setup
- Set up port forwarding on your router: forward external port (e.g., 2342) to Raspberry Pi’s port 2342
- Use Dynamic DNS services if your external IP changes frequently
- For security, use a VPN or tools like Tailscale to access remotely without exposing ports publicly
Additional Tips
- Ensure your firewall on Raspberry Pi and router allows traffic on port 2342
- Backup your PhotoPrism storage folder regularly (
/media/pi/myssd/photoprism/storage) - Adjust PhotoPrism settings via its web interface for indexing intervals, user management, and performance
Key takeaways 5
- A Raspberry Pi 4 with 64-bit OS can run PhotoPrism.
- Docker and the Docker Compose plugin handle installation.
- Store photos and the database on an external SSD or HDD.
- Configure the containers to restart automatically on boot.
- Secure remote access before exposing it to the internet.
Watch & learn
Frequently asked questions
What is PhotoPrism?
PhotoPrism is an open-source, self-hosted photo management app that organizes, tags and searches your photo library, similar to Google Photos but running on your own hardware.
Can a Raspberry Pi run PhotoPrism?
Yes. A Raspberry Pi 4 with at least 2 GB of RAM (4 GB or more recommended) and a 64-bit OS can run PhotoPrism with Docker; indexing large libraries takes time.
How do I access PhotoPrism remotely?
Use a VPN such as WireGuard or Tailscale, or a reverse proxy with HTTPS and strong authentication, rather than exposing the port directly to the internet.
Learn it hands-on at AL Academy
Free practical programs in software, automation and IT, with labs and certificates.
Related articles

A Comprehensive Guide to Raspberry Pi Crypto Mining: Turn Your Pi into a Money Maker
Are you ready to delve into the world of cryptocurrency mining with your Raspberry Pi?

Containerized Web Apps with Docker
Containers did not just make web apps easier to build. They quietly rewrote what it means to host one.

VPS & Linux Server Administration
Renting a server is cheap and easy. Owning the responsibility that comes with it is the part nobody warns you about, and the part that turns a developer into a sysadmin.

Comments
No comments yet. Start the conversation.