These are instructions for advanced users, wanting to run PhotoStructure for Servers.
Please make sure you've read the pros and cons of both approaches before continuing.
Step 1: Accept the license #
Please read and accept the end-user license agreement. Installing and running PhotoStructure indicates your agreement to all terms in the license.
Step 2: Make sure you're on supported hardware #
PhotoStructure for Node is only tested on Ubuntu LTS (18.04), and requires a 64-bit CPU.
Step 3: Install Node.js #
Install NodeJS. PhotoStructure requires version 10 or later. We recommend the current LTS version.
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -; sudo apt install nodejs
Step 4: Install required tools #
sudo apt install -y build-essential python2.7-dev git perl ffmpeg sqlite3 dcraw libjpeg-turbo-progs
See also: https://github.com/nodejs/node-gyp#installation.
Step 5: Create a role user (optional) #
Consider creating a role user to run PhotoStructure, as you should do for any service.
sudo adduser --disabled-password photostructure
This role user needs read access to where your photos and videos are, and write access to
- the directory that holds your PhotoStructure library
(If you'd rather
/var/tmp be used as a scratch directory, set the
PS_TMP_DIR environment variable appropriately).
Step 6: Clone and run #
This assumes you’re going to install photostructure into the new role user’s home directory, ~photostructure.
sudo --login --user photostructure bash cd ~photostructure git clone https://github.com/photostructure/photostructure-for-servers.git
And launch PhotoStructure:
The first time you run
start.sh, it will download and compile dependencies, which will take a minute, and then launch PhotoStructure. Subsequent starts will be much faster, unless there is a new release, which will be pulled down automatically and recompilation will happen as needed.
The output of
start.sh will be a localhost URL to your library. Open the URL in your browser on that machine to finish setup.
Note that the PhotoStructure web service binds to localhost only by default, so if you want to access it elsewhere, you need to set the
exposeNetworkWithoutAuth library setting to true, or set the environment variable PS_EXPOSE_NETWORK_WITHOUT_AUTH to 1. Note that as of version 0.6, there is no authentication functionality within PhotoStructure. This feature will be added in a subsequent release.
After the URL is emitted to the terminal, if you use the
--pidfile $PIDFILE option, the process will daemonize and return you to your shell prompt.
photostructure-for-servers/start.sh --help to get supported CLI options.
Shut down PhotoStructure #
If you’re running
start.sh in the foreground in a terminal, just hit ctrl-c.
If you’ve daemonized it with a –pidfile, run something like
photostructure-for-servers/photostructure --stop --pidfile /var/run/photostructure.pid