Install Infrastructure for Linux using the package manager

New Relic Infrastructure for Linux can be installed using several package managers.

Before installation, make sure to:

Install the agent

  1. Create the configuration file and add your license key:
    echo "license_key: YOUR_LICENSE_KEY" | sudo tee -a /etc/newrelic-infra.yml
  2. Determine the distribution version number:
    Debian
    cat /etc/os-release
    Ubuntu
    cat /etc/lsb-release
    Amazon Linux, CentOS, RHEL
    cat /etc/os-release
    SLES
    cat /etc/os-release | grep VERSION_ID
  3. Enable New Relic's GPG key.
    Debian
    curl -s https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg | sudo apt-key add -
    Ubuntu
    curl -s https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg | sudo apt-key add -
    Amazon Linux, CentOS, RHEL

    yum automatically installs the GPG key using the value in gpgkey.

    SLES
    sudo rpm --import https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg
  4. Add the Infrastructure agent repository:
    Debian
    Debian 8 ("Jessie")
    printf "deb [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt jessie main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
    Debian 9 ("Stretch")
    printf "deb [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt stretch main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
    Debian 10 ("Buster")
    printf "deb [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt buster main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
    Ubuntu
    Ubuntu 12 ("Precise")
    printf "deb [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt precise main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
    Ubuntu 14 ("Trusty")
    printf "deb [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt trusty main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
    Ubuntu 16 ("Xenial")
    printf "deb [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt xenial main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
    Ubuntu 18 ("Bionic")
    printf "deb [arch=amd64] https://download.newrelic.com/infrastructure_agent/linux/apt bionic main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
    Amazon Linux
    Amazon Linux
    sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/el/6/x86_64/newrelic-infra.repo
    Amazon Linux 2
    sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/el/7/x86_64/newrelic-infra.repo
    CentOS / RHEL
    CentOS 5, RHEL 5
    sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/el/5/x86_64/newrelic-infra.repo
    CentOS 6, RHEL 6
    sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/el/6/x86_64/newrelic-infra.repo
    CentOS 7, RHEL 7
    sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/el/7/x86_64/newrelic-infra.repo
    CentOS 8, RHEL 8
    sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/el/8/x86_64/newrelic-infra.repo
    SLES
    SLES 11.4
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/11.4/x86_64/newrelic-infra.repo
    SLES 12.1
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/12.1/x86_64/newrelic-infra.repo 
    SLES 12.2
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/12.2/x86_64/newrelic-infra.repo 
    SLES 12.3
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/12.3/x86_64/newrelic-infra.repo 
    SLES 12.4
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/12.4/x86_64/newrelic-infra.repo  
  5. Refresh the repositories:
    Debian
    sudo apt-get update
    Ubuntu
    sudo apt-get update
    Amazon Linux, CentOS, RHEL
    sudo yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra'
    SLES
    sudo zypper -n ref -r newrelic-infra
  6. Install the newrelic-infra package in root (default), privileged user, or unprivileged user mode. For more information on each running mode, see Linux agent running modes.

    Root (default)
    • Debian and Ubuntu:
      sudo apt-get install newrelic-infra -y
    • Amazon Linux, CentOS, RHEL:
      sudo yum install newrelic-infra -y
    • SLES:
      sudo zypper -n install newrelic-infra
    Privileged user

    Install the libcap library and set the NRIA_MODE environment variable to PRIVILEGED.

    • Debian and Ubuntu:
      sudo apt-get install libcap2-bin
      sudo NRIA_MODE="PRIVILEGED" apt-get install newrelic-infra
    • Amazon Linux, CentOS, RHEL:
      sudo yum install libcap
      sudo NRIA_MODE="PRIVILEGED" yum install newrelic-infra
    • SLES:
      sudo zypper install libcap-progs
      sudo NRIA_MODE="PRIVILEGED" zypper install newrelic-infra
    Unprivileged user

    Install the libcap library and set the NRIA_MODE environment variable to UNPRIVILEGED.

    • Debian and Ubuntu:
      sudo apt-get install libcap2-bin
      sudo NRIA_MODE="UNPRIVILEGED" apt-get install newrelic-infra
    • Amazon Linux, CentOS, RHEL:
      sudo yum install libcap
      sudo NRIA_MODE="UNPRIVILEGED" yum install newrelic-infra
    • SLES:
      sudo zypper install libcap-progs
      sudo NRIA_MODE="UNPRIVILEGED" zypper install newrelic-infra

Once the agent is installed or updated, follow the common steps to start, stop, or check the Infrastructure agent status.

As of version 1.4.0, the Infrastructure agent package includes the additional newrelic-infra-ctl binary, which is used to help troubleshoot a running agent. Although this binary is not required to execute the agent, we recommend to add it in your path.

Install using configuration management tools

To install Infrastructure with a configuration management tool, see the documentation for:

Install for Docker containers on instrumented hosts

See Docker instrumentation for Infrastructure.

Install using tarball files

For custom setup scenarios, you can install the agent using our tarball files in assisted or manual modes.

This is especially useful when you need to adapt the default installation settings to your environment, or to install Infrastructure on Linux distributions that lack the newrelic-infra package in their repositories.

Installing the agent using tarball files is not supported.

Update the agent

Follow standard procedures to update the Infrastructure agent.

If you are using sudo to install or update the agent, use the -E argument to allow bypassing the environment variables, or specify the NRIA_MODE environment variable just after sudo.

export NRIA_MODE="SET_MODE_HERE"
sudo -E YOUR_PACKAGE_MANAGER_UPDATE_COMMAND

What's next?

Generate some traffic and wait a few minutes, then view your hosts in the Infrastructure UI. If no data appears after waiting a few minutes, see No data appears.

The only required configuration option is the license_key setting, which is created as part of the installation procedures. You may also want to:

The hostname for your server cannot be localhost. Data will not be reported for servers with that name. Make sure the host name uses a unique name.

For more help

Recommendations for learning more: