Wiki > PhotoPrism
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.
PhotoPrism runs on its own port; 18459 has been automatically generated for you, but you may choose another 5 digit port between 10000 and 32767.
Installation
- SSH to your slot
- Clone the repository:
git clone https://github.com/photoprism/photoprism.git ~/.build/photoprism
- Change to the PhotoPrism build directory:
cd ~/.build/photoprism
- Remove reference to sudo:
sed -i 's/sudo npm install -g/npm install/' Makefile
- Build initial dependences:
make all DESTDIR=$HOME/apps/photoprism
- Ignore errors in the previous step that reference
cannot find -ltensorflow
orsqlite3-binding.c
- Run the following commands:
DESTDIR="$HOME/apps/photoprism"
mkdir -p "$DESTDIR"
env TMPDIR="$HOME/photoprism" ./scripts/dist/install-tensorflow.sh "$DESTDIR"
rm -rf --preserve-root "$DESTDIR/include"
(cd "$DESTDIR" && mkdir -p bin sbin lib assets config config/examples)
chmod +w $HOME/go/pkg/mod/github.com/tensorflow/tensorflow*/tensorflow/go/{,lib.go}
sed -i "s#cgo LDFLAGS: -ltensorflow#cgo LDFLAGS: -L $DESTDIR/lib -ltensorflow#" $HOME/go/pkg/mod/github.com/tensorflow/tensorflow*/tensorflow/go/lib.go
./scripts/build.sh prod "$DESTDIR/bin/photoprism"
GOBIN="$DESTDIR/sbin" go install github.com/tianon/gosu@latest
(cd frontend && env NODE_ENV=production npm run build)
rsync -r -l --safe-links --exclude-from=assets/.buildignore --chmod=a+r,u+rw ./assets/ "$DESTDIR/assets"
wget -O "$DESTDIR/assets/static/img/wallpaper/welcome.jpg" https://cdn.photoprism.app/wallpaper/welcome.jpg
wget -O "$DESTDIR/assets/static/img/preview.jpg" https://cdn.photoprism.app/img/preview.jpg
cp scripts/dist/heif-convert.sh "$DESTDIR/bin/heif-convert"
cp internal/config/testdata/*.yml "$DESTDIR/config/examples"
MySQL database
See the MySQL / MariaDB article for directions on the initial setup of MySQL / MariaDB.
Once MariaDB is installed, connect to it:
mysql --socket=/home/$USER/.config/mysql/mysqld.sock
Then run the following query to create the photoprism database:
CREATE DATABASE photoprism
CHARACTER SET = 'utf8mb4'
COLLATE = 'utf8mb4_unicode_ci';
PhotoPrism configuration
Create the directories that will contain your photos:
mkdir -p $HOME/Photos/Originals $HOME/Photos/Import
Create the PhotoPrism configuration file using nano or similar: nano ~/apps/photoprism/config/config.yml
:
Debug: false
DarktableBin: /usr/bin/darktable-cli
AssetsPath: /home/user/apps/photoprism/assets
CachePath: /home/user/apps/photoprism/cache
OriginalsPath: /home/user/Photos/Originals
ImportPath: /home/user/Photos/Import
TempPath: /home/user/.tmp
HttpServerHost:
HttpMode: release
HttpPort: 18459
HttpPassword:
DatabaseDriver: mysql
DatabaseUser: user
DatabaseServer: /home/user/.config/mysql/mysqld.sock
Theme: lavendel
Language: english
Starting PhotoPrism
Start PhotoPrism with the following command:
~/apps/photoprism/bin/photoprism --defaults-yaml=~/apps/photoprism/config/config.yml --admin-password=insecure start
Log in to PhotoPrism using the initial credentials:
- URL: http://server.whatbox.ca:18459
- User:
admin
- Password:
insecure
Go to http://server.whatbox.ca:18459/settings/account and change the default password.
Continue to the First Steps to begin using PhotoPrism.
HTTPS
- Go to the Box setup page to configure HTTPS
- Click "Add App"
- Enter the subdomain of your choice (eg "photos") and the port above (18459)
- PhotoPrism should now be accessible via the HTTPS link generated.