Ubuntu 18.04

These instructions are for installing PM415, MySQL, and Elastic Search on a single instance.

Requirements

  • Ubuntu 18.04 or higher

  • A SendGrid account for invitation links, password resets, and comments

  • Firewall rules to open ports 80, 443 and 9200

  • Root access

Install Node.js

curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
sudo apt-get install nodejs
sudo apt-get install build-essential

Install PM415

git clone https://github.com/mreider/pm415
cd pm415
sudo npm install
sudo npm install uuid --s

Install MySQL (MariaDB)

Answer 'Y' to the secure installation prompts.

Edit the file /etc/elasticsearch/elasticsearch.yml and add the following

Start the service and check its status

If you see an error like 'Cannot allocate memory' you must be running a small instance. Lower the JVM heap size by editing the file /etc/elasticsearch/jvm.options by changing the values xms1g to xms100m and xmx1g to xmx100m.

If you changed your heap size - restart the service as follows:

Install Caddy Server to support SSL

Caddyarrow-up-right is HTTP server that supports automatic SSL through LetsEncryptarrow-up-right. The following installs the personal version of Caddy.

Give caddy the ability to bind to privileged ports as a non-root user:

Set up needed user, group, and directories

Create Caddy Systemd service unit

Edit the file /etc/caddy/Caddyfile as follows:

Start the caddy service

Create environment variables

Edit the file /etc/environment and add the following environment variables

Load environment variables into your session

Run database migrations

Configure the app

Edit ~/pm415/config.js to change the appkey and add your domain to the whitelist and siteURL

Install and start pm2

Last updated

Was this helpful?