Skip to main content

Install New Relic on Your Application

Install and configure the New Relic monitoring agent on your application to measure and improve performance, with step-by-step instructions for multiple runtimes.

Prerequisites

  • A New Relic account (create one at newrelic.com )
  • Your New Relic License Key (found under Account settings)
  • Access to restart or redeploy your application

Step 1 — Get Your License Key

  1. Log into your New Relic account.
  2. Navigate to Account settings.
  3. Copy your License Key — you'll need it for the agent configuration.

Step 2 — Install the Agent

Choose the agent for your runtime:

npm install newrelic --save

Create newrelic.js in the root of your project:

exports.config = {
app_name: ['Your App Name'],
license_key: process.env.NEW_RELIC_LICENSE_KEY,
logging: {
level: 'info',
},
};

Require the agent at the very top of your entry file:

require('newrelic');
// rest of your app

Step 3 — Restart the Application

Once the agent is configured, restart or redeploy your application. New Relic will start sending data to your account within a few minutes.

Monitoring Alternatives

ToolStrengthsConsiderations
New RelicEasy setup, broad language supportCost at scale
DatadogExcellent multi-cloud and integrationsCan be costly at scale
DynatraceAI-driven auto-optimizationSteeper learning curve
AppDynamicsDeep performance analyticsRequires detailed initial config

Best Practices

  • Continuous monitoring: Regularly review metrics and configure alerts to respond quickly to incidents.
  • Cost analysis: Re-evaluate your plan as application traffic grows to avoid unexpected charges.
  • Keep configuration updated: Revisit agent settings after significant application changes.
  • Follow official docs: Always check New Relic's documentation for the latest agent versions and configuration options.