2022-08-08
Install Photoprism on QNAP NAS Using Docker Compose
X:piwigo_photo_gallery
Photoprism is a modern, searchable, well organized web gallery of your photos and videos. At the moment of writing, the official documentation, does not contain a dedicated instructions on how to install Photoprism on QNAP NAS. This article is meant to fill that gap. Installation described here was done on TS-251+ (Celeron J1900 4 Cores) but should be applicable to wide variety of other QNAP NAS models.
- What is the photoprism
- Feature Overview
- Installation on QNAP NAS from the CLI
- Prerequisites
- login to your NAS server via SSH
- Create photoprism directory
- Create
docker-compose.yml
file - Create directories in
/share/Container/photoprism
- Run application in the container
- Manual upgrading Photoprism to the latests version
- Adding new content
- Performance tuning
- References
What is the photoprism
from the photoprism website:
PhotoPrism® is an AI-Powered Photos App for the Decentralized Web. It makes use of the latest technologies to tag and find pictures automatically without getting in your way. You can run it at home, on a private server, or in the cloud.
Feature Overview
- Browse all your photos and videos without worrying about RAW conversion, duplicates or video formats
- Easily find specific pictures using powerful search filters
- Recognizes the faces of your family and friends
- Automatic classification of pictures based on their content and location
- Play Live Photos by hovering over them in albums and search results
- Since the User Interface is a Progressive Web App, it provides a native app-like experience, and you can conveniently install it on the home screen of all major operating systems and mobile devices
- Includes 4 high-resolution World Maps to bring back the memories of your favorite trips
- Metadata is extracted and merged from Exif, XMP, and other sources such as Google Photos
- Many more image properties like Colors, Chroma, and Quality can be searched as well
- Use PhotoSync to securely backup iOS and Android phones in the background
- WebDAV clients such as Microsoft's Windows Explorer and Apple's Finder can connect directly to PhotoPrism, allowing you to open, edit, and delete files from your computer as if they were local
NOTE: I haven't found functionality to add other accounts than administrator. But in my case having only single user is perfectly fine.
Installation on QNAP NAS from the CLI
Prerequisites
This instruction assumes that you are familiar with using command line interface (CLI).
- ensure you have installed Container Station which is providing Docker on QNAP NAS
- ensure that you have docker in the path
login to your NAS server via SSH
from the terminal or use e.g. putty
if working on Windows
Create photoprism directory
mkdir /share/Container/photoprism
cd photoprism
Create docker-compose.yml
file
download docker-compose.yml
from the link provided in official documentation :
wget https://dl.photoprism.app/docker/docker-compose.yml
Assuming that you keep your original photos in /share/Multimedia/photos
modify volume mount for photoprism/originals
. To do that, edit volumes
part of the docker-compose.yml
file you just downloaded and provide proper mapping for the /photoprism/originals
.
volumes:
# "/host/folder:/photoprism/folder" # Example
- "/share/Multimedia/zdjecia:/photoprism/originals" # Original media files
NOTE: Other things you might want to modify in the
docker-compose.yml
are: - default password for the user admin (default is:insecure
) - number of workers - disable Tensorflow (used for categorization of photos and face detection)For changing number of workers and disabling TensorFlow see the "Performance tuning" section bellow.
Create directories in /share/Container/photoprism
mkdir /share/Container/photoprism/database
mkdir /share/Container/photoprism/import
mkdir /share/Container/photoprism/originals
mkdir /share/Container/photoprism/storage
Run application in the container
Start the container. Pulling images might take few minutes depending on your Internet connection speed.
docker-compose up -d
NOTE: From July 2023 Compose V1 invoked as
docker-compose
stopped receiving updates. It’s also no longer available in new releases of Docker Desktop. Compose V2 was announced in 2020, is written in Go, and is invoked asdocker compose
.
after that, Photoprism should be available under:
http://<YOUR-NAS-IP>:2342
You need to login as administrator with default password for the first time, after login remember to change that password in settings.
Using web-UI
Now, you can trigger indexing your photos and videos using web-UI or from CLI.
Using CLI
docker exec -ti photoprism photoprism index
Manual upgrading Photoprism to the latests version
cd /share/Container/photoprism/
docker pull photoprism/photoprism:latest
docker stop photoprism
docker-compose up -d
For automated updates check Watchtower
Adding new content
- use upload via webDAV
- manually upload new pictures and videos to
/share/Multimedia/Import
and manually trigger import using CLI:
docker exec photoprism photoprism import
You can also consider automating import by adding import
do the cron (e.g. every midnight)
Performance tuning
If you are experiencing performance problems you can reduce number of workers (from documentation):
Try reducing the number of workers by setting
PHOTOPRISM_WORKERS
to a reasonably small value indocker-compose.yml
, depending on the CPU performance and number of cores
or disable TensorFlow:
As a last measure, you can disable the use of TensorFlow for image classification and facial recognition. You ca do it via web-UI settings, cli (
--disable-tensorflow
option) or setPHOTOPRISM_DISABLE_TENSORFLOW
totrue
indocker-compose.yml
and restart container.
Credits: I was able to launch this service thanks to the instructions found on reddit [1] provided by schol4stiker.
References
Updates
- 2023-08-11: add note about change in docker compose to v2. Thx Tom Berg.