---
title: Install the infrastructure agent for Linux
source: https://docs.newrelic.com/docs/infrastructure/infrastructure-agent/linux-installation/package-manager-install
---

The quickest way to get started with our [infrastructure agent](https://docs.newrelic.com/docs/infrastructure/infrastructure-monitoring/get-started/get-started-infrastructure-monitoring/) is through our [guided install](https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/cross-product-functions/install-configure/new-relic-guided-install-overview/). If you're in the EU, try our EU guided install. If you're in the JP region, try our JP guided install.

[Guided install](https://one.newrelic.com/marketplace/install-data-source?state=645882f8-fbb6-fc03-025f-a934ba3a3738)

[EU guided install](https://one.eu.newrelic.com/marketplace/install-data-source?state=645882f8-fbb6-fc03-025f-a934ba3a3738)

[JP guided install](https://onenr.io/0bRKrBNeEwE)

> #### 💡 TIP
>
> You can also get started with our [infrastructure agent](https://docs.newrelic.com/docs/infrastructure/infrastructure-monitoring/get-started/get-started-infrastructure-monitoring/) using [configuration management tools](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/linux-installation/install-configuration-management-tools).

## Step-by-step instructions [#manual-install]

You can install the agent manually. Before installing infrastructure, be sure to:

-   Review the [requirements](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/getting-started/compatibility-requirements-new-relic-infrastructure).
-   Have a valid license key.

To install infrastructure in Linux, follow these instructions:

1.  Create the configuration file and add your license key:

    ```bash
    echo "license_key: YOUR_LICENSE_KEY" | sudo tee -a /etc/newrelic-infra.yml
    ```
2.  Determine the distribution version number:

    ** Debian**

    ````bash
    cat /etc/os-release
    ```

    ````

    ** Ubuntu**

    ````bash
    cat /etc/lsb-release
    ```

    ````

    ** Amazon Linux,  CentOS,  Rocky Linux,  RHEL,  AlmaLinux & Oracle Linux**

    ````bash
    cat /etc/os-release
    ```

    ````

    ** SLES**

    ````bash
    cat /etc/os-release | grep VERSION_ID
    ```

    ````
3.  Enable New Relic's GPG key:

    ** Debian**

    ````bash
    curl -fsSL https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/newrelic-infra.gpg
    ```
    <DNT>
      **Debian 13 ("trixie")**
    </DNT>

    ```bash
    curl -fsSL https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra-sha256.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/newrelic-infra.gpg
    ```

    ````

    ** Ubuntu**

    ````bash
    curl -fsSL https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/newrelic-infra.gpg
    ```

    ````

    ** Amazon Linux,  CentOS,  Rocky Linux,  RHEL,  AlmaLinux & Oracle Linux**

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

    ** SLES**

    ````bash
    curl https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg -s | sudo gpg --import
    ```

    <Callout variant="important">
      There's a known issue with zypper package manager where GPG keys may not be validated as expected in older SLES versions. If you get errors such as `Signature verification failed`, update your infrastructure agent to version 1.44.0 or higher.
    </Callout>

    ````
4.  Add the infrastructure agent repository:

    ** Debian**

    **Debian 11 ("Bullseye")**

    ````bash
    echo "deb https://download.newrelic.com/infrastructure_agent/linux/apt bullseye main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
    ```

    <DNT>
      **Debian 12 ("Bookworm")**
    </DNT>

    ```bash
    echo "deb https://download.newrelic.com/infrastructure_agent/linux/apt bookworm main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
    ```

     <DNT>
      **Debian 13 ("trixie")**
    </DNT>

    ```bash
    echo "deb https://download.newrelic.com/infrastructure_agent/linux/apt trixie main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
    ```

    ````

    ** Ubuntu**

    **Ubuntu 18.04 LTS (Bionic Beaver)**

    ````bash
    echo "deb https://download.newrelic.com/infrastructure_agent/linux/apt bionic main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
    ```

    <DNT>
      **Ubuntu 20.04 LTS (Focal Fossa)**
    </DNT>

    ```bash
    echo "deb https://download.newrelic.com/infrastructure_agent/linux/apt focal main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
    ```

    <DNT>
      **Ubuntu 20.10 (Groovy Gorilla)**
    </DNT>

    ```bash
    echo "deb https://download.newrelic.com/infrastructure_agent/linux/apt groovy main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
    ```

    <DNT>
      **Ubuntu 21.04 (Hirsute Hippo)**
    </DNT>

    ```bash
    echo "deb https://download.newrelic.com/infrastructure_agent/linux/apt hirsute main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
    ```

    <DNT>
      **Ubuntu 22.04 (Jammy Jellyfish)**
    </DNT>

    ```bash
    echo "deb https://download.newrelic.com/infrastructure_agent/linux/apt/ jammy main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
    ```

    <DNT>
      **Ubuntu 24.04 (Noble Numbat)**
    </DNT>

    ```bash
    echo "deb https://download.newrelic.com/infrastructure_agent/linux/apt/ noble main" | sudo tee -a /etc/apt/sources.list.d/newrelic-infra.list
    ```

    ````

    ** Amazon Linux**

    **Amazon Linux 2 (x86)**

    ````bash
    sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/amazonlinux/2/x86_64/newrelic-infra.repo
    ```

    <DNT>
      **Amazon Linux 2 (arm64)**
    </DNT>

    ```bash
    sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/amazonlinux/2/aarch64/newrelic-infra.repo
    ```

    <DNT>
      **Amazon Linux 2023 (x86)**
    </DNT>

    ```bash
    sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/amazonlinux/2023/x86_64/newrelic-infra.repo
    ```

    <DNT>
      **Amazon Linux 2023 (arm64)**
    </DNT>

    ```bash
    sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/amazonlinux/2023/aarch64/newrelic-infra.repo
    ```

    ````

    ** CentOS /  Rocky Linux /  RHEL/  AlmaLinux & Oracle Linux**

    **CentOS, RHEL, Oracle Linux 7.x (x86)**

    ````bash
    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
    ```

    <DNT>
      **CentOS RHEL, Oracle Linux 7.x (arm64)**
    </DNT>

    ```bash
    sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/el/7/aarch64/newrelic-infra.repo
    ```

    <DNT>
      **CentOS, RHEL, RockyLinux, AlmaLinux, and Oracle Linux 8.x (x86)**
    </DNT>

    ```bash
    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
    ```

    <DNT>
      **CentOS, RHEL, RockyLinux, AlmaLinux, and Oracle Linux 8.x (arm64)**
    </DNT>

    ```bash
    sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/el/8/aarch64/newrelic-infra.repo
    ```

    <DNT>
      **RockyLinux, AlmaLinux and RHEL 9.x (x86)**
    </DNT>

    ```bash
    sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/el/9/x86_64/newrelic-infra.repo
    ```

    <DNT>
      **RockyLinux, AlmaLinux and RHEL 9.x (arm64)**
    </DNT>

    ```bash
    sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/el/9/aarch64/newrelic-infra.repo
    ```

    <DNT>
      **RockyLinux, AlmaLinux and RHEL 10.x (x86_64)**
    </DNT>

    ```bash
    sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/el/10/x86_64/newrelic-infra.repo
    ```

    <DNT>
      **RockyLinux, AlmaLinux and RHEL 10.x (arm64)**
    </DNT>

    ```bash
    sudo curl -o /etc/yum.repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/yum/el/10/aarch64/newrelic-infra.repo
    ```

    ````

    ** SLES**

    **SLES 12.5 (x86)**

    ````bash
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/12.5/x86_64/newrelic-infra.repo
    ```

    <DNT>
      **SLES 12.5 (ARM)**
    </DNT>

    ```bash
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/12.5/aarch64/newrelic-infra.repo
    ```

    <DNT>
      **SLES 15.2 (x86)**
    </DNT>

    ```bash
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/15.2/x86_64/newrelic-infra.repo
    ```

    <DNT>
      **SLES 15.2 (ARM)**
    </DNT>

    ```bash
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/15.2/aarch64/newrelic-infra.repo
    ```

    <DNT>
      **SLES 15.3 (x86)**
    </DNT>

    ```bash
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/15.3/x86_64/newrelic-infra.repo
    ```

    <DNT>
      **SLES 15.3 (ARM)**
    </DNT>

    ```bash
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/15.3/aarch64/newrelic-infra.repo
    ```

    <DNT>
      **SLES 15.4 (x86)**
    </DNT>

    ```bash
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/15.4/x86_64/newrelic-infra.repo
    ```

    <DNT>
      **SLES 15.4 (ARM)**
    </DNT>

    ```bash
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/15.4/aarch64/newrelic-infra.repo
    ```

    <DNT>
      **SLES 15.5 (x86)**
    </DNT>

    ```bash
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/15.5/x86_64/newrelic-infra.repo
    ```

    <DNT>
      **SLES 15.5 (ARM)**
    </DNT>

    ```bash
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/15.5/aarch64/newrelic-infra.repo

    ```
     <DNT>
      **SLES 15.6 (x86)**
    </DNT>

    ```bash
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/15.6/x86_64/newrelic-infra.repo

    ```
     <DNT>
      **SLES 15.6 (ARM)**
    </DNT>

    ```bash
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/15.6/aarch64/newrelic-infra.repo
    ```
     <DNT>
      **SLES 15.7 (x86)**
    </DNT>

    ```bash
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/15.7/x86_64/newrelic-infra.repo

    ```
     <DNT>
      **SLES 15.7 (ARM)**
    </DNT>

    ```bash
    sudo curl -o /etc/zypp/repos.d/newrelic-infra.repo https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/15.7/aarch64/newrelic-infra.repo
    ```

    ````
5.  Refresh the repositories:

    ** Debian**

    ````bash
    sudo apt-get update
    ```

    ````

    ** Ubuntu**

    ````bash
    sudo apt-get update
    ```

    ````

    ** Amazon Linux,  CentOS,  Rocky Linux,  RHEL,  AlmaLinux & Oracle Linux**

    ````bash
    sudo yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra'
    ```

    ````

    ** SLES**

    ````bash
    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](https://docs.newrelic.com/docs/infrastructure/install-configure-infrastructure/linux-installation/linux-agent-running-modes).

    **Root (default)**

    -   **![Debian.png](https://docs.newrelic.com/images/os_icon_debian.webp "Debian.png") Debian and ![ubuntu icon](https://docs.newrelic.com/images/os_icon_ubuntu.webp "ubuntu icon") Ubuntu**:

        ```bash
        sudo apt-get install newrelic-infra -y
        ```
    -   **![amazon linux.png](https://docs.newrelic.com/images/os_icon_amazon-linux.webp "amazon linux.png") Amazon Linux, ![centos icon](https://docs.newrelic.com/images/os_icon_centos.webp "centos icon") CentOS, ![rocky icon](https://docs.newrelic.com/images/os_icon_rockylinux.webp "rocky icon") Rocky Linux, ![redhat icon](https://docs.newrelic.com/images/os_icon_redhat.webp "redhat icon") RHEL, ![AlmaLinux icon](https://docs.newrelic.com/images/os_icon_almalinux.webp "AlmaLinux icon") AlmaLinux & Oracle Linux**:

        ```bash
        sudo yum install newrelic-infra -y
        ```
    -   **![suse icon](https://docs.newrelic.com/images/os_icon_suse.webp "suse icon") SLES**:

        ```bash
        sudo zypper -n install newrelic-infra
        ```

    **Privileged user**

    Install the libcap library and set the [`NRIA_MODE`](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/linux-installation/linux-agent-running-modes/#set-mode) environment variable to `PRIVILEGED`.

    -   **![Debian.png](https://docs.newrelic.com/images/os_icon_debian.webp "Debian.png") Debian and ![ubuntu icon](https://docs.newrelic.com/images/os_icon_ubuntu.webp "ubuntu icon") Ubuntu**:

        ```bash
        sudo apt-get install libcap2-bin
        ```

        ```bash
        sudo NRIA_MODE="PRIVILEGED" apt-get install newrelic-infra
        ```
    -   **![amazon linux.png](https://docs.newrelic.com/images/os_icon_amazon-linux.webp "amazon linux.png") Amazon Linux, ![centos icon](https://docs.newrelic.com/images/os_icon_centos.webp "centos icon") CentOS, ![rocky icon](https://docs.newrelic.com/images/os_icon_rockylinux.webp "rocky icon") Rocky Linux, ![redhat icon](https://docs.newrelic.com/images/os_icon_redhat.webp "redhat icon") RHEL, ![AlmaLinux icon](https://docs.newrelic.com/images/os_icon_almalinux.webp "AlmaLinux icon") AlmaLinux & Oracle Linux**:

        ```bash
        sudo yum install libcap
        ```

        ```bash
        sudo NRIA_MODE="PRIVILEGED" yum install newrelic-infra
        ```
    -   **![suse icon](https://docs.newrelic.com/images/os_icon_suse.webp "suse icon") SLES**:

        ```bash
        sudo zypper install libcap-progs
        ```

        ```bash
        sudo NRIA_MODE="PRIVILEGED" zypper install newrelic-infra
        ```

    **Unprivileged user**

    Install the libcap library and set the [`NRIA_MODE`](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/linux-installation/linux-agent-running-modes/#set-mode) environment variable to `UNPRIVILEGED`.

    -   **![Debian.png](https://docs.newrelic.com/images/os_icon_debian.webp "Debian.png") Debian and ![ubuntu icon](https://docs.newrelic.com/images/os_icon_ubuntu.webp "ubuntu icon") Ubuntu**:

        ```bash
        sudo apt-get install libcap2-bin
        ```

        ```bash
        sudo NRIA_MODE="UNPRIVILEGED" apt-get install newrelic-infra
        ```
    -   **![amazon linux.png](https://docs.newrelic.com/images/os_icon_amazon-linux.webp "amazon linux.png") Amazon Linux, ![centos icon](https://docs.newrelic.com/images/os_icon_centos.webp "centos icon") CentOS, ![rocky icon](https://docs.newrelic.com/images/os_icon_rockylinux.webp "rocky icon") Rocky Linux, ![redhat icon](https://docs.newrelic.com/images/os_icon_redhat.webp "redhat icon") RHEL, ![AlmaLinux icon](https://docs.newrelic.com/images/os_icon_almalinux.webp "AlmaLinux icon") AlmaLinux & Oracle Linux**:

        ```bash
        sudo yum install libcap
        ```

        ```bash
        sudo NRIA_MODE="UNPRIVILEGED" yum install newrelic-infra
        ```
    -   **![suse icon](https://docs.newrelic.com/images/os_icon_suse.webp "suse icon") SLES**:

        ```bash
        sudo zypper install libcap-progs
        ```

        ```bash
        sudo NRIA_MODE="UNPRIVILEGED" zypper install newrelic-infra
        ```

Once the infrastructure agent is installed or updated, you can [start, stop, or check the agent status](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/configuration/start-stop-restart-check-infrastructure-agent-status).

## Update the agent [#update]

Follow standard procedures to [update the infrastructure agent](https://docs.newrelic.com/docs/update-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`](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/linux-installation/linux-agent-running-modes/#set-mode) environment variable just after `sudo`.

```bash
export NRIA_MODE="SET_MODE_HERE"
```

Or

```bash
sudo -E YOUR_PACKAGE_MANAGER_UPDATE_COMMAND
```

## What's next? [#what-next]

Generate some traffic and wait a few minutes, then [view your hosts in the New Relic UI](https://docs.newrelic.com/docs/infrastructure-metrics). If necessary, follow our troubleshooting procedures if [no data appears](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/troubleshooting/no-data-appears-infrastructure).

> #### ⚠️ IMPORTANT
>
> 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](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/getting-started/compatibility-requirements-new-relic-infrastructure#hostname).

The only required [configuration option](https://docs.newrelic.com/docs/infrastructure/install-configure-infrastructure/configuration/configure-infrastructure-agent) is the [`license_key`](https://docs.newrelic.com/docs/infrastructure-configure-your-agent#conf-license_key) setting, which is created as part of the installation procedures. You may also want to:

-   [Learn to use your host data](https://docs.newrelic.com/docs/tutorial-troubleshoot-infra-hosts/diagnose-app-infra-data) to troubleshoot an alert event.
-   [Add custom attributes](https://docs.newrelic.com/docs/Infrastructure-configure-your-agent#conf-custom_attributes) to annotate your infrastructure data.
-   [Connect your AWS account](https://docs.newrelic.com/docs/infrastructure-amazon-aws-ec2-integration#connect) if your servers are hosted on Amazon EC2.
-   Enable [log forwarding](https://docs.newrelic.com/docs/logs/enable-new-relic-logs/1-enable-logs/forward-your-logs-using-new-relic-infrastructure-agent).
-   Add other [New Relic infrastructure integrations](https://docs.newrelic.com/docs/infrastructure/introduction-infra-monitoring) to collect data from external services.
