|:.:.:.:.:.:.:.:.:/.:.:.:.:.:./.:.:.:.:.:.:.:.:.:.:.:.:.:./|   '. :.:.:.:.:.:.:.:.:.:.l.ヽ:.:.:.:.l:.:.:.:.:.:.:.:.:.:∧\:.:.:.',
          |:.:.:.:.:.:.:./.:.:.:.:.:./.:.:.:.:.:.:.:.:.:.:.:.: , ′   l :.:.:.:.:.:.:.:.:.:| ∨.:.:.l:.:.:.:.:.:.:.:.:.:.∧ \:.'.
          |:.:.:.:.:.:/.:.:.:.:.: /.:.:.:.:.:.:.:.:. ヽ/ /    |:.:.:.:.:.:.:./:.:.|   y'.:.:|:.:.:.:.|:.:.:.:.:.:.∧   ヘ.
          |:.:.:.:./.:.:.:.//.:.:.:.:.:.:.:.:.:.:/ \,′   !:.:.:.:.:.:/|:.:./,/ '.:.:| :.:.:.|:.:.:.:.:.:.:.:.|
          |:.:.:/.:.:./.:./.:.:.:.:.:.:.:.:./   /` ‐-‐'|:.:.:./ |ァ'´    |:.:| :.:.:.|:.:.:.:.:.:.:.:.|
          |:.:.i.:.:./.:.:.: '.:.:.:.:.:.:.:/   ,/       |:.:.:/   ′    }.:.| :.:.:.|:.:.:.| :.:.:.:|
          |:.:.|:./.: rヘ|:.:.:.:.:.:/:.| 三三三三三  |:./   三三三 ハ|:.:.:.:.|:.:.:.| :.:.:.:|
          |:.:.l〃.:{  |:.:.:.:./.:.:.|             l.'         .i.:.:.i.:.:.:∧ :.:|ヽ :.:|
          |:.:./.:.:.:.\|:.:.:/.:.:.:.:|                '       |:.:.||:.:/  :.:.| '.:.:l
          |:./.:.:.:.:.:.:. !:./.:.:.:.:.:.'、            ,.ー--、    }.:.:|レ′ ∨  V
          |/.:.:.:.:.:.:.:.:V '´  ̄`ヽ.、            ´`¨¨{. |_.  '.:.:.:.|
         /.:.:.:.:.:.:.:./         ヘ `    . __. -r1 |:.:.:.:.:.:.:.:.|
         :.:.:.:.:.:.:, '         '. \    | _.   -┴ー──┴┐
         :.:.:.:.:./           |  \  r' |   -──────i'
    

< KONAKONA.MOE >

How to Install Photoprism (Natively on Debian)

Last Mod.: 2024-06-04 | Created On: 2024-05-19


I regret installing this already, there’s no mobile apps just a shitty PWA that takes 30 seconds to load! PhotoSync doesn’t work because I’m too lazy to get WebDAV working. Photoprism is a fucking joke do not use it 33 trillion stars on github and no iOS or even ANDROID APP?

Update your System

1apt update
2apt dist-upgrade

Install Optional Dependencies

1apt install -y ffmpeg exiftool darktable libpng-dev libjpeg-dev libtiff-dev imagemagick libheif-examples

Install Photoprism

1mkdir -p /opt/photoprism
2cd /opt/photoprism
3wget -c https://dl.photoprism.app/pkg/linux/amd64.tar.gz -O - | tar -xz
4ln -sf /opt/photoprism/bin/photoprism /usr/local/bin/photoprism
5photoprism --version

Photoprism System User

Create an user for the Photoprism. I use an user called “share”, this user has access to my personal files, the files that I don’t want other processes on my system to go rogue and see them. Create an user like this, maybe add nologin on /etc/passwd or something.

Environment Variables

Somewhere on the home folder of the share user create a file named .env or better yet .photoprism_env.

 1PHOTOPRISM_AUTH_MODE="password"
 2PHOTOPRISM_ADMIN_USER="diowo" # Just use your name, if you leave empty you'll
 3                              # (the sys. admin) will just log in as "admin" 
 4
 5PHOTOPRISM_ADMIN_PASSWORD="mystrong72max8minpassword"
 6
 7PHOTOPRISM_STORAGE_PATH="/var/lib/share/photoprism_storage" # /var/lib/share is the home folder of my share
 8                                                            # user create something like photoprism_storage
 9                                                            # inside share's home.
10
11PHOTOPRISM_ORIGINALS_PATH="/mnt/raid/Media/Gallery" # original files directory
12PHOTOPRISM_ORIGINALS_LIMIT="-1" # disable max size for files
13PHOTOPRISM_IMPORT_PATH="false"
14PHOTOPRISM_AUTO_IMPORT="-1" 
15
16PHOTOPRISM_SITE_CAPTION="Photoprism"
17
18PHOTOPRISM_UPLOAD_NSFW="true"
19PHOTOPRISM_DETECT_NSFW="true"

Make sure to chown share:share -R these files and maybe chmod them too.

SystemD Unit File

/usr/lib/systemd/system/photoprism.service

 1[Unit]
 2Description=Photoprism service
 3After=network.target
 4
 5[Service]
 6Type=simple
 7User=share
 8Group=share
 9UMask=007
10WorkingDirectory=/opt/photoprism
11EnvironmentFile=/var/lib/share/.photoprism_env
12ExecStart=/opt/photoprism/bin/photoprism up
13ExecStop=/opt/photoprism/bin/photoprism down
14
15[Install]
16WantedBy=multi-user.target

Very straight forward, just change the location of .photoprism_env or its name if you need. UMask 007 makes it so that user:group can do virtually anything but others can’t even read it.

Staring the Service

1systemctl daemon-reload
2systemctl enable --now photoprism

Photoprism will be available locally on port 2342.

Reverse Proxy Config

Your usual Caddy config shit:

/etc/caddy/Caddyfile

1photoprism.yourdomain.tld {
2    reverse_proxy localhost:2342
3    encode gzip
4    log
5}

Make sure you secure this shit before exposing.

Credits & Thanks

I stole parts of this guides and adapted it for my needs. I wrote this guide for myself but I hope this is useful to someone.


Prev:
Fixing Jellyfin Song Playlists (They SUCK!!!)
Next:
How to Install Photoview (Native, on Debian with …