This is a quick guide for people using Yunohost to install Photoprism.
Full installation instructions in the Photoprism Documentation
Before you Start
Hard Drive: You should install Photoprism on a drive with at least the same amount of free space as your photo collection. E.g. 20 GB of photos - have at least 20 GB of free space. Photoprism will create thumbnails and other files that will take up a good portion of space. Swap space: Have at least as much as your installed RAM. If your swap partition is too small, switch to a swapfile. RAM Photoprism seems to use about 2 GB of RAM while idle. If you are using almost the whole amout of your RAM, nextcloud, and xmpp will cut in and out. With Photoprism, and all your services idling, I would suggest at least having 1 GB of RAM free.
Install Docker-Compose
sudo apt install docker-compose
Download Docker Config File
cd ~
wget https://dl.photoprism.org/docker/docker-compose.yml
Make Changes to Config File
nano docker-compose.yml
Make these changes:
PHOTOPRISM_ADMIN_PASSWORD: SECUREPASSWORDHERE
PHOTOPRISM_SITE_URL: ""http://domain.com:2342/""
#PHOTOPRISM_DATABASE_DRIVER: ""sqlite"" #comment this out
PHOTOPRISM_DATABASE_DRIVER: ""mysql"" #use this one
volumes: #example setup - best to have /.photoprism folder in your photos folder to easily move your photo collection to another computer, or system later
#Storage folder for settings, index & sidecar files (DON'T REMOVE):
- ""/photos/.photoprism:/photoprism/storage""
#Your personal photo and video collection ([local path]:[container path]):
- ""/photos/originals:/photoprism/originals""
#Mounting the import folder is optional (see docs):
- ""/photos/import:/photoprism/import""
#Uncomment the following lines to use MariaDB instead of SQLite for improved performance & scalability:
mariadb:
image: mariadb:10.5
restart: unless-stopped
command: mysqld --transaction-isolation=READ-COMMITTED --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=512 --innodb-rollback-on-timeout=OFF --innodb-lock-wait-timeout=50
volumes:
- ""/var/lib/mysql""
environment:
MYSQL_ROOT_PASSWORD: PASSWORDHERE
MYSQL_USER: photoprism
MYSQL_PASSWORD: DIFFERENTPASSWORDHERE
MYSQL_DATABASE: photoprism
Start Photoprism
docker-compose up -d
Test Photoprism
Does it work?
- In a web browser, go to https://IP_ADDRESS_OF_YUNOHOST:2342 Ex. On my local network, I go to http://192.168.1.181:2342.
- Type in your password.
- Look around the interface.
Do A Small Test Import
Put a collection of photos, say 1 month, or one event of photos in the previously defined import folder.
NOTE: Before importing, I would suggest turning off Stacks. Stacks automatically ‘stacks’ photos together that it thinks are the same photo, or if they are named in a similar fashion. Right now, there is no way to batch unstack a photo, so you could have a photo with 10-20 photos ‘stacked’ inside of it and the only way to unstack it is to painfully click ‘unstack’, wait 10 seconds for it to do it, then go the the next one and do it again. Anyways, trust me…*uncheck the stacks option. Go to Settings > General and uncheck the 3 options in Stacks.
-
To start the import you can do it in two ways:
- In the web browser: Library > Move > check the Move Files tickbox > Click Import. You can watch it’s progress in Library > Logs
- From the command line:
docker-compose exec photoprism photoprism import
-
During the import:
- Use
htop
to check your RAM utilization. If you have lots of RAM you can even turn off the 2 workers setting in the docker-compose.yml - Use other services on Yunohost to see if they are functioning. Photoprism uses more RAM while importing, so it won’t be a major problem except for your first big import.
- Use
-
After the import:
- Browse your collection to make sure you like Photoprism and want to continue
- Think about how and when you will import the rest of your photos, do it overnight. It could take a few days. I had 176 GB of photos and it took me about 3-4 days.
Make it work on Public URL
-
Create a Domain for Photoprism
sudo yunohost domain add photo.domain.tld
-
Install Certificate for the Domain
sudo yunohost domain cert-install photo.domain.tld
-
Install Redirect Nginx App
sudo yunohost app install redirect
Label for Redirect: Photoprism (what you want to show in Yunohost SSO tile)
Choose a domain for your redirect: photo.domain.tld
Choose a path for your redirect: /
Redirect destination path: http://localhost:2342/
Redirect type: nginx,proxypass (no need for password on Photoprism, but double safe to keep it on there)
- Remove Floating Yunohost Button
The floating navigation button is very intrusive when using Photoprism on mobile. It gets in the way, so the best thing is to disable it.
sudo nano /etc/nginx/conf.d/photos.domain.tld.d/redirect.conf
Comment out these lines:
#Include SSOWAT user panel.
#include conf.d/yunohost_panel.conf.inc;
#more_clear_input_headers 'Accept-Encoding';
Photoprism Maintenance
- If you change options in docker-compose.yml, restart the container:
docker-compose stop photoprism
docker-compose up -d --no-deps photoprism
- To update the Docker image:
docker-compose pull photoprism
docker-compose stop photoprism
docker-compose up -d --no-deps photoprism