Running PhotoPrism on a Synology NAS¶
Frequently Asked Questions¶
Does my device meet the system requirements?¶
Visit the Synology Knowledge Base to learn what kind of CPU and how much memory your device has. We recommend a 64-bit processor with at least 2 cores and 4 GB of memory. While PhotoPrism has been reported to work on devices with 2 GB of memory, we won't take responsibility for instability or performance issues.
You will have to resort to 32-bit Docker images to run PhotoPrism and MariaDB on ARMv7-based entry-level devices like the Synology DS218j.
Indexing large photo and video collections significantly benefits from local SSD storage instead of traditional hard drives commonly used in NAS devices. Especially the conversion of RAW images and the transcoding of videos are very demanding.
If your server runs out of memory, the index is frequently locked, or other system resources are running low
while indexing, you should try reducing the number of workers
PHOTOPRISM_WORKERS to a reasonably small value in
docker-compose.yml (depending on the performance
of the server). As a measure of last resort, you may disable using TensorFlow for image classification and facial recognition.
Will my NAS be fast enough?¶
This largely depends on your expectations and the number of files you have. Most users report that PhotoPrism runs well on their Synology NAS. However, initial indexing may take much longer than on standard desktop computers.
Also keep in mind that the hardware has no video transcoding support and software transcoding is generally slow.
Setup using Docker¶
We recommend following these instructions to install PhotoPrism on your Synology NAS:
Setup using Portainer¶
This community-maintained guide is currently out of date. Updating it to work with the latest Portainer version is a great way to contribute! 🌷
Click the edit link to perform changes and send a pull request.
This guide will help you install PhotoPrism in your Synology NAS using Portainer, an open-source container manager system. The guide will cover the following steps:
- install Portainer in your Synology NAS using Task Manager;
- configure Portainer to use your Synology's docker endpoint;
- install PhotoPrism in your Synology NAS using Portainer, accessible over http / direct IP;
- (TO-DO) configure a reverse proxy in your Synology NAS to access PhotoPrism over https / custom domain name.
Step 1: Install Portainer in your Synology NAS using Task Manager¶
Synology's official docker app is quite limited in terms of functionality and that is the reason why we will install Portainer first. It will make managing docker containers inside Synology much more easier and functional while sharing the same local docker endpoint (i.e. the same docker images / containers / volumes / etc. will be manageable in both Synology's app and Portainer). We could install it using the terminal / SSH connection to the NAS but in this way everything can be done using Synology's Diskstation Manager UI.
To install Portainer:
- install Synology's Docker app from the official package center;
- open Synology's File Station app and browse to the newly created docker shared folder;
- create a folder named portainer inside docker, which will persist relevant Portainer's data in our local filesystem.
open Synology's Control Panel > Task Scheduler and create a new Scheduled Task > User-defined script; you'll then need to fill in some details in the General, Schedule and Task Settings sections.
4.1. in General fill in:
4.1.1. Task: use a meaningful name, for e.g. Install Portainer;
4.1.2. User: keep this as root.
4.2. in Schedule fill in:
4.2.1. Date: set the task to run on a specific date (for eg. today) and choose Do not repeat. This task will be used just once to install Portainer, we don't want to run it afterwards;
4.2.2. Time: leave the default settings, they have no relevance;
4.3. in Task Settings fill in:
4.3.1. Run command: copy/paste the user defined script below. Check if the ports are available on your NAS and that the path to the volume is correct (it should point to the folder created in step 3 above):
docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /volume1/docker/portainer:/data portainer/portainer-ce
click OK; then, on the list of scheduled tasks, select the newly created task and hit Run; follow the prompts to install Portainer; in the end you can delete the task or keep it – just uncheck the enabled checkbox to disable the task.
Portainer should now be acessible in your local network in http://[YOUR-LOCAL-IP]:9000/.
Step 2: Configure Portainer to use your Synology's docker endpoint¶
- Open Portainer by visiting http://[YOUR-LOCAL-IP]:9000/;
- Choose and confirm a strong password; you will manage Portainer using this password and the admin username;
- Select Docker - Manage the local Docker environment to link Portainer to your Synology's local docker endpoint and hit Connect; Portainer's admin page should open;
- Click Environment in the left menu, then local and under Public IP place your local NAS IP (it should be the same [YOUR-LOCAL-IP] of step 6.
Step 3: Install PhotoPrism in your Synology NAS using Portainer, accessible over http / direct IP¶
With Portainer installed we can use a docker-compose file to deploy a stack composed by PhotoPrism and MariaDB to quickly get PhotoPrism running in our NAS. We can use PhotoPrism's default docker-compose yml file.
- open Synology's File Station app and browse to the docker shared folder;
- create a folder named photoprism inside docker, which will persist relevant Photoprism's data in our local filesystem;
- inside photoprism folder, create three more folders: storage, originals and database.
- Open Portainer by visiting http://[YOUR-LOCAL-IP]:9000/;
- Click Stacks in the left menu, then Add stack, give it a meaningful name (for eg. Photoprism) and in the Web Editor place the content of PhotoPrism's default docker-compose yml file.
BE SURE TO USE YOUR OWN PHOTOPRISM_ADMIN_PASSWORD, PHOTOPRISM_DATABASE_PASSWORD, MYSQL_ROOT_PASSWORD, AND MYSQL_PASSWORD BY CHANGING THE VALUES ACCORDINGLY, AND CHECK THE LOCAL VOLUMES PATHS TO MATCH THOSE DEFINED IN STEP 13.
- Click Deploy the stack. Give it a few minutes and PhotoPrism should be accessible in http://[YOUR-LOCAL-IP]:[LOCAL-PORT]/.
Synology automatically creates thumbnail files inside a special
@eaDir folder when uploading
media files such as images.
PhotoPrism now ignores folders starting with
@ so that you don't need to manually exclude
them in a
.ppignore file anymore.
Step 4: Configure a reverse proxy in your Synology NAS to access PhotoPrism over https / custom domain name¶
Synology allows you to configure a nginx reverse proxy to serve your applications over HTTPS. Configurations can be made in Diskstation manager Control Panel, Application Portal, Reverse proxy.: Click create. [Description] give it a meaningful name (for eg. PhotoPrism) [Protocol]=HTTPS [Hostname]=[YOUR-HOSTNAME] [Port]=[YOUR-PORT] (for eg. 2343) check Enable HSTS and HTTP/2 . under Destination [Protocol]=HTTP [Hostname]=[YOUR-LOCAL-IP][PORT]=[YOUR-PORT] (default is 2342) Last step under Custom Header.: Click create [Websocket] and hit OK (this step makes that your browser receive photo counts, log messages, or metadata updates).
IMPORTANT: make sure that you have forwarded the selected port (for eg. 2343) in your router: