Production Deployment
Instructions for deploying Study Tracker in a generic production environment
Last updated
Instructions for deploying Study Tracker in a generic production environment
Last updated
Once you are ready to deploy Study Tracker to a remote host, follow the steps below. These instructions assume that you have done a few things already:
Created a VM with the following things installed:
JDK 17+
Maven
Git
PostgreSQL Client
Created a PostgreSQL database that can be used by Study Tracker.
Have an SMTP server you can use for sending emails.
(optional) Create an OpenSearch 2+ host for enabling Study Tracker's power search functionality.
(optional ) .
Install required system packages, if needed:
(Optional) If running on AWS, you should install the AWS CLI as well:
If you have not already done so externally, create a new database schema and user for Study Tracker on your PostgreSQL host using the installed psql
client:
(Optional) If you are planning on re-using and overwriting an existing Study Tracker database, it is recommended you refresh it using Flyway. First, in the web
directory of the Study Tracker source code, a create a new file named flyway.conf
and provide the following parameters:
Run Flyway to clean and populate the database with initial state:
Clone the Study Tracker source code repository and checkout the latest stable build:
Compile the application source code:
Create separate a directory to run the application from (eg. /opt/study-tracker
):
Create default file storage locations for file uploads and study data:
(Optional) Create a JKS keystore for SAML (Single Sign-On w/ Okta) authentication in the run directory /opt/study-tracker
Create a application.properties
file in the run directory /opt/study-tracker
. You can use the application.properties.example
file in the top-level of the Study Tracker source code repository as a template. The required fields are below:
Once the above steps have been completed and the Study Tracker .war
file has been added to your run directory, alongside the application.properties
file, you can run it with the following command:
In the directory /etc/systemd/system/
create a file named study-tracker.service
and give it the following contents:
Start the service:
Enable auto-start of the application on server restart:
Generate a PKCS12 keystore for handling encryption keys and save it to the application run directory (eg. /opt/study-tracker
). For example, to generate a keystore and self-signed certificate:
Configure Study Tracker to use SSL and your created keystore by adding the following attributes to your application.properties
file:
Create a JKS keystore for SAML (Single Sign-On w/ Okta) authentication in the application run directory (eg. /opt/study-tracker
):
In most cases, it is possible to perform an in-place upgrade of Study Tracker by pulling the latest version of the source code repository and checking out the stable build you are interested in.
Upgrades always have the potential to go wrong, so be sure to back-up your instance and PostgreSQL database before proceeding. There is no need to backup the ElasticSearch database, as it rebuilds itself automatically on startup.
Stop the application server:
Pull the latest commit:
Build the application:
Copy the artifacts to your run directory and restart the service:
Follow the steps in the section to configure your provider of choice.