Scripted Photoprism Installation (TrueNAS CORE)

Scripted Installation of Photoprism and Caddy with options to run behind a reverse proxy, self-signed cert, or completely independent and managing/renewing its own certs automatically using Caddy.

Unfortunately, the newer versions of Photoprism are compiled using AVX instructions, which my CPU doesn’t currently support. Therefore this script will only work with 12.x jails.

This script will create a jail, install photoprism and caddy using a $FQDN of your choosing, and mount the data outside the jail. This makes it easy to rebuild the jail without losing your data. It will also acquire a valid Let’s Encrypt certificate and keep it renewed using Caddy.

Reinstall is supported without having to move or backup your data.

Instructions and downloads are at

2 Likes

Hi, this post is not related to a problem with the script (it work perfectly), but more about a problem im encountering trying to set mount point properly… hope someone else have installed photoprism can help me to resolve.
Sostantially, i have followed the instruction, and after the install complete i have a folder/dataset photoprism outside the jail, as expected, but i don’t know how to let photoprism index another dataset, where actually i store all my photo.
Every attemps “broke” the jail, in read in instruction

  • It is possible to mount other datasets containg photos into the jail AFTER you have installed it.

but actually i don’t know how to do. The /photos/original folder is outside the jail, and i can’t mount anything on it; i don’t want to “double” my media, will be a pain

Have you tried to adjust jails > photoprism > mountpoints from the UI? Or add a new one?

Yes, but seems that if the media are not stored in photos/originals folder photoprism can’t index them, and photos/originals is actually outside the jail so i can’t mount anything on this path.
If my destination mount point is a path that exist in the point mounted by jail (example, photos/originals/test) the jail broke with 502 error

There should be a mount point configured for your jail. Change the “outside” path to the one where your photos are stored while leaving the “inside” path as is.

this broke the jail with 502 error, is not what you mean right? (the original path:/mnt/SSDPool/photoprism/photos, where are stored all folders/file created by the installer)

This was what I meant. @victor probably can provide more insight, sorry.

1 Like

The script mounts your photos and config path (which should be POOL_PATH/photoprism/photos) at /mnt/photos inside the jail. Don’t use this mount point for adding new mounts. Instead you should be using something else like /mnt/custom or /mnt/other because /mnt/photos is already being used. Your config file is also stored there.

Once you do that you will also need to chown -R photoprism:photoprism /mnt/custom from INSIDE the jail.

The /mnt/photos is where your config file is stored so that’s why you’re getting the error. It might be necessary to set that mount back where it was, or if that doen’t work, reinstalling the script.

thanks as always, I’ve lost count of the beers I should offer you :sweat_smile:
i have mounted my dataset following ur tip (i just add read only property, in case…), apply the permission, and i resolve the 502 error.
Now, i see the dataset well mounted inside the jail, but i still can’t access the media inside. Or, for sure, im missing some part to configure photoprism :exploding_head:

edit: i tried to change in options file the originalpath to /mnt/custom but nothing change

Can you see the photos inside it when you do ls /mnt/custom?

yes, but i see the folder where photo are stored, maybe is that the issue?

Screenshot?

Also, have you looked for an option in photoprism that might rescan your files?

Screenshot 2024-06-20 172449

in photoprism i didn’t see any change from the previous situation, he didnt find any files in every menu; in the option i didnt find anything

edit: i tried to create a symlink like read on web, but didn’t work
ln -s /mnt/custom /mnt/photos/originals

That should not be necessary. The mount points should work. I’m thinking there is a way to rescan and reindex new files.

actually the only thingh worth is place file in the originals folder… nothing else.

2024-06-20 19:09:10 INFO indicizzazione completata in 0 secondi

2024-06-20 19:09:10 INFO index: updated 0 files [10.850011ms]

2024-06-20 19:09:10 INFO index: found no new or modified files

2024-06-20 19:09:10 INFO index: found no .ppignore file

2024-06-20 19:09:10 INFO indicizzando gli originali...

Mount your existing photo store in the “originals” folder, perhaps? Victor?

That is probably the solution from what I read here.
Unfortunately my server CPU does not support AVX so I can’t run photoprism anymore.

Probably /mnt/photos/originals/custom

I have tried, trust me, but always 0 new file index after 1 second scan :face_exhaling:

Sorry, what u mean with

Probably /mnt/photos/originals/custom

Mount your photos into the jail at /mnt/photos/originals/custom instead of /mnt/custom

Error: [EFAULT] jail: ioc-photoprism: mount.fstab: /mnt/SSDPool/iocage/jails/photoprism/root/mnt/photos/originals/otherdataset: No such file or directory

changed the directory because the symlink created go in error too

Error: [EFAULT] jail: ioc-photoprism: mount.fstab: /mnt/SSDPool/iocage/jails/photoprism/root/mnt/photos/originals/custom is a symbolic link```