To install the New Relic server agent on Ubuntu:

echo 'deb http://apt.newrelic.com/debian/ newrelic non-free' | sudo tee /etc/apt/sources.list.d/newrelic.list
sudo mkdir /tmp
wget -O- https://download.newrelic.com/548C16BF.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install newrelic-sysmond
sudo usermod -a -G docker newrelic
sudo nrsysmond-config --set license_key=<license_key>
sudo /etc/init.d/newrelic-sysmond start

https://docs.newrelic.com/docs/servers/new-relic-servers-linux/installation-configuration/servers-installation-ubuntu-debian

If you are using sails.js:

You have to lift the application using node app.js instead of sails lift.

On sails.js you can then require the newrelic package:

if(process.env.NODE_ENV === 'production'){
    process.env.NEW_RELIC_HOME = './config/newrelic';
    global.newrelic = require('newrelic');
}

Then, in your layout file:

<%- global.newrelic.getBrowserTimingHeader() %>