Ursa Server Installation Instructions

By Steve Hackbarth | 11/14/2016

1. Provision Server

  • Linux VM (4-core, 8GB RAM, 200GB hard disk minimum recommendation)
  • Web ports (80 & 443) open, HIPAA-compliant SSL cert

2. Install Dependencies

  • PostgreSQL (version 9.6+, with postgresql-devel package)
  • R (version 3.2+)
  • g++ (version 4.8+)
  • Redis (version 3+)
  • NodeJS (version 6.9+)
  • npm (version 3.10+)
  • pm2 (version 2.1+)
  • nginx (version 1.8+)
  • AWS CLI
  • Database driver binaries (unless fully-Postgres installation, e.g. Oracle Instant Client)
  • Postgres Foreign Data Wrapper binaries (unless fully-Postgres installation)

Now would be a good time to start the postgres, nginx, and redis services. We can provide sample/recommended postgres and nginx configuration files. Best practices are to allow SSL support in postgres. If you skip this step you’ll have to set the environment variable ESCHEW_PG_SSL=true.

3. Set Environment Variables

Installations are configured by means of environment variables, as described in our configuration page.

Set the following environment variables in etc/profile.d/ursa.sh, or /etc/environment, or whichever file you use to save your environment variables.

You’ll also have to make the URSA_HOME and URSA_OUTPUT_DIR directories and chown them to your non-root user.

4. Load Ursa Software

aws configure # ... enter your Ursa license keys
aws s3 cp s3://ursa-app-builds/latest $URSA_HOME --recursive
cd $URSA_HOME
npm run build-ursa

If you have a restrictive network environment you might need to whitelist https://ursa-app-builds.s3.amazonaws.com in order for the aws s3 cp command to work.

5. Cron

Set up nightly and weekly maintenance script using cron. An example crontab file may look like:

30 2 * * * . /etc/profile.d/ursa.sh; cd $URSA_HOME && /usr/local/bin/node ./scripts/nightly.js >> $URSA_OUTPUT_DIR/cron-log.txt 2>> $URSA_OUTPUT_DIR/cron-error.txt
0 1 * * 1 . /etc/profile.d/ursa.sh; cd $URSA_HOME && /usr/local/bin/node ./scripts/weekly.js >> $URSA_OUTPUT_DIR/cron-log.txt 2>> $URSA_OUTPUT_DIR/cron-error.txt

6. Run Service

Once the dependent postgreSQL, nginx, and redis services are running, the Ursa Server can be managed through the following commands:

cd $URSA_HOME
npm run start-production
npm run stop-production