• /
  • EnglishEspañolFrançais日本語한국어Português
  • Log inStart now

Install the Java agent on AWS Elastic Beanstalk

|View as Markdown

This page covers installing the New Relic Java agent on AWS Elastic Beanstalk by adding the agent to your application bundle and configuring the -javaagent JVM argument through the Elastic Beanstalk console.

Compatibility and requirements

Supported

  • Java 8, 11, 17, 21, 24, 25, and 26 (Java 7 supported on agent v6.5.4 and earlier only)
  • Elastic Beanstalk Tomcat platform
  • Elastic Beanstalk Java SE platform
  • See compatibility and requirements for supported framework and library version ranges

Not supported

  • Docker containers on Elastic Beanstalk — use the Docker install method instead
  • Running alongside other APM agents — the Java agent cannot guarantee correct behavior when another APM agent is active in the same JVM

You need

Install

Download newrelic-java.zip and extract newrelic.jar and newrelic.yml: [#install-step-1]

bash
$
curl -O https://download.newrelic.com/newrelic/java-agent/newrelic-agent/current/newrelic-java.zip
$
unzip newrelic-java.zip

Add newrelic.jar and newrelic.yml to WEB-INF/lib/ in your WAR file, then repackage and deploy.

Add newrelic.jar and newrelic.yml to a subdirectory in your project (for example, opt/newrelic/).

Add a Procfile at the root of your source bundle with the -javaagent flag:

web: java -javaagent:opt/newrelic/newrelic.jar -jar YOUR_APPLICATION.jar

Repackage and deploy the source bundle.

Configure

Edit newrelic.yml and set the two required values:

  1. Set license_key to your .
  2. Set app_name to a meaningful name for your application.

Tomcat platform only — Pass the -javaagent flag via the Elastic Beanstalk console:

  1. Open the Elastic Beanstalk console and select your environment.

  2. In the left pane, select Configurations.

  3. Scroll to Updates, monitoring, and logging and click Edit.

  4. Under Platform Software, add to the JVM Options field:

    -javaagent:/full/path/to/newrelic.jar

    To find the path to newrelic.jar on the EC2 instance, connect to the instance and run:

    bash
    $
    sudo find /var -name "newrelic.jar"
    $
    sudo find /usr -name "newrelic.jar"
  5. Click Apply.

For all other configuration options, see Java agent configuration.

Verify your install

Elastic Beanstalk will update your environment. Send at least two requests, then wait 2–3 minutes and your app appears in APM & services.

If no data appears after five minutes, see No data appears (Java).

Copyright © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.