Install on Linux Natively

Using systemd and rsyslog to provide reliable service

Operating System Compatibility

This guide is written with RHEL or Amazon Linux 2 in mind. If you are running a different distribution of Linux, steps may vary.

This guide will walk through installing GRAX from scratch natively on a Linux operating system. It will configure a service to automatically restart GRAX if it fails, and create a rsyslog helper service to copy logs from stdout to a log retention file. Optional steps as take-home exercises would include log rotation, and syslog streaming.


Never set up a publicly-accessible instance of the GRAX application without modifying the ADMIN_PASSWORD in the configuration away from these examples

Installation Steps

Before you begin the steps below, many of them require root access. Start by logging in as root, or elevating your session to a point where you have sudo capabilities.

Download and Expand GRAX Executable

To download the GRAX application, simply request it from GRAX HQ:

$ curl -L --output

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    67  100    67    0     0    740      0 --:--:-- --:--:-- --:--:--   797
100 47.5M    0 47.5M    0     0  5738k      0 --:--:--  0:00:08 --:--:-- 7915k

GRAX HQ serves this download as a gzipped tar, meaning you will need to expand it to get the contained binaries:

$ unzip

  inflating: github_event.json
  inflating: grax
  inflating: graxctl

Mark the resultant files executable for later use:

$ chmod +x grax graxctl

[no output expected]

Create a Configuration File

Create a .env file with a valid configuration by creating secret values, using your DB connection string, and adding the domain name of your web server. In most cases, this domain name is of the format, but can be decided by your networking team.

Generate a secure random value for each of the values marked [GENERATE] below. A length of at least 30 characters each is recommended. You can generate such a value with openssl rand -base64 48 | tr "+/" "-_" | tr -d = in most linux distributions.

$ vim .env

DATABASE_URL=postgres://username:[email protected]:5432/database-name

If your disk configuration dictates that GRAX cache data in a location other than your OS-default TMPDIR (usually /tmp), you can override that value by adding TMPDIR=/new/path to the above. For more information, see here.

Create a GRAX Service Configuration

Use systemd to ensure GRAX stays running as a background service. Ensure you replace the paths in this configuration with the proper pathes to the executable and environment files created above:

$ vim /lib/systemd/system/grax.service

Description=grax daemon

Start all the Services in Order

To start everything in the proper order, run the systemctl commands like this:

$ systemctl daemon-reload && systemctl restart rsyslog.service && systemctl enable grax.service && systemctl restart grax.service && journalctl -f -u grax.service

[json structured logs streaming here]

The services should now be online.

Next Steps

To proceed with connecting GRAX to Salesforce and your storage platform of choice, start with our connection documentation.