Home » How to Install and Use PhotoPrism on Your Raspberry Pi

How to Install and Use PhotoPrism on Your Raspberry Pi

by Staff
0 comment

In the world of self-hosted photo managers which can run on the Raspberry Pi, PhotoPrism is one of the most competent. It boasts an impressive search function, face recognition, and even a world map showing the locations where your photos were taken! It’s also shockingly easy to install on a Raspberry Pi.

How to Install PhotoPrism on Your Raspberry Pi

Before you go any further, you need to prepare your Raspberry Pi as server. You should then connect to your Raspberry Pi via SSH (Secure Shell), then update and upgrade all installed packages.

ssh pi@your.pi.local.ip
sudo apt update
sudo apt upgrade

PhotoPrism requires at least 4GB RAM in order to run in without crashing. If you don’t have 4GB, you can expand the available memory on your Pi by increasing the amount of virtual memory. Doing this will rapidly degrade your microSD card, but if you’re booting your Raspberry Pi from SSD, there are unlikely to be any problems.

PhotoPrism is meant to be installed and configured via docker-compose, so wget the docker-compose file:

wget https:

Use nano to edit the docker-compose.yml file:

nano docker-compose.yml

You will be faced with a wall of text. The first things you need to change at this point are the passwords, which are, by default, set to “insecure”.

PhotoPrism is set to look for photos in /home/pi/Pictures. If you wish, you can alter this further down in the Volumes section. Save and exit nano with Ctrl + O then Ctrl + X.

The PhotoPrism docker-compose file includes a container for PhotoPrism itself, as well as a containerized version of MariaDB. Use docker-compose to pull these onto your system and set up containers:

docker-compose pull

When the process has completed, bring the containers online in detached mode—allowing them to run in the background:

docker-compose up -d

Check the containers have been successfully started with:

docker-compose ps

You can now access PhotoPrism on your.local.pi.ip:2342. The username is admin, and the password is what you specified in docker-compose.yml.

Accessing PhotoPrism From Outside Your Home Network

PhotoPrism will work perfectly well inside your home network, but if you want to access it while away from home, you need a domain name and an Apache configuration file.

Visit your domain registrar’s Advanced DNS section and create a new record. For the type, select A, for the host set “@”, and in the value field, type your public IP address.

Head back over to the terminal, change directory and create a new conf file for Apache.

cd /etc/apache2/sites-available/
sudo nano photos.conf

In the text file, paste:

<VirtualHost *:80>
ServerName your-domain-name.tld
ProxyPass /api/v1/ws ws:
ProxyPassReverse /api/v1/ws ws:
ProxyPass / http:
ProxyPassReverse / http:
ProxyRequests off

Save and exit nano with Ctrl + O then Ctrl + X.

Enable the configuration, then restart Apache.

sudo a2ensite photos.conf
sudo service apache2 restart

Run Certbot to fetch and deploy security certificates and encryption keys from Let’s Encrypt:

sudo certbot

Enter your email address, and select which site you want to secure from a list, then restart Apache again. You can now visit your PhotoPrism instance by visiting https://your-domain-name.tld! Again, the username is admin, and the password is what you specified in docker-compose.yml.

Getting Started With PhotoPrism on Your Raspberry Pi

If you went with the defaults in the docker-compose.yml file, PhotoPrism will look for photos in /home/pi/Pictures.

If you have a stash of images on your local machine, you can use secure copy (scp) to send these to the correct directory on your Pi.

scp -r /path/to/your/images

They will not immediately appear in PhotoPrism, and you will need to manually trigger a scan. Click the film roll icon on the left-hand side, check the Complete rescan box, then hit Start. Depending on the size of your image collection, the scan could take hours or even days, and if you do not have sufficient RAM or virtual memory, will crash your Pi.

When the process has finished, your photos will be indexed, thumbnails will be generated, objects and faces will be tagged, and a map showing the locations your photos were taken will be available. In the search field, you can look for photos taken in a particular year or month, in a certain country, or with a specific camera.

PhotoPrism will also have used its TensorFlow-powered machine learning to generate tags, which group images together. These are usually quite accurate, although they can occasionally be wildly off. While PhotoPrism correctly identified monuments, memorials, meerkats, and masks in our test gallery, it incorrectly tagged a cat as a monkey, a dog as a lizard, and a hardback book as a monitor.

The map feature is fantastic, and provided you have location data enabled on your camera or phone, you can use the map to search for specific photos or relive holidays or trips abroad. Use your mouse wheel to scroll in for a better view.

Adding Photos to PhotoPrism

PhotoPrism doesn’t have a native mobile client, but the developers recommend installing PhotoSync on your Android or iOS device to synchronize images on your phone with your PhotoPrism server.

Alternatively, you can use SyncThing to automatically upload from certain folders. If you already have a NextCloud server, you can use the NextCloud mobile client to upload to NextCloud, and PhotoPrism will use WebDav to check recent arrivals according to a schedule you set. To enable this, click the cog icon on the bottom of the sidebar, select the Sync tab, then Add server, and enter the details of your NextCloud WebDav endpoint. Click Save, then set how often you want PhotoPrism to check for new images. This can be a value between hourly, weekly, and never.

PhotoPrism Is One of the Best Self-Hosted Photo Solutions for the Raspberry Pi

With a stunning array of features which make cataloging, organizing, and searching through your photos a breeze, PhotoPrism outclasses most other competitors in the field. The software is still in development and new features are being added on a regular basis—make sure to update regularly if you want to take advantage of them.

Read the full article here

You may also like

Leave a Comment

Iman Hearts is one of the biggest lifestyle news and articles portals, we provide the latest news and articles about family, lifestyle, entertainment, and many more, follow us to get the latest news about what matters to you.


© 2022 Iman Hearts. All rights reserved. Sitemap