---
title: Configure the infrastructure agent using Chef
source: https://docs.newrelic.com/docs/infrastructure/infrastructure-agent/config-management-tools/configure-chef
---

Read on to learn how to use New Relic's Chef recipes to install and configure New Relic's infrastructure agent. For how to use Chef recipes, see the [Chef docs](https://www.chef.io/solutions/infrastructure-automation/).

The New Relic cookbook is available in the [Chef Supermarket](https://supermarket.chef.io/cookbooks/newrelic-install). It will help you scale your New Relic observability efforts. To achieve this, it uses the [New Relic CLI](https://github.com/newrelic/newrelic-cli) and [our open install repository](https://github.com/newrelic/open-install-library). This is a [community-supported](https://github.com/newrelic/chef-install) effort.

## Compatibility and requirements [#requirements]

Our Chef recipe has the following requirements:

-   Chef versions 15 or higher

Supported platforms:

-   Amazon Linux all versions
-   CentOS version 5 or higher
-   Debian version 7 ("Wheezy") or higher
-   Red Hat Enterprise Linux (RHEL) version 5 or higher
-   Ubuntu versions 16.04._, 18.04._, 20.04\* (LTS versions)
-   Windows Server 2008, 2012, 2016, and 2019, and their service packs.
-   SUSE Linux Enterprise 11, 12

## Chef recipes [#recipes]

Infrastructure monitoring has one default recipe: `default`. Include this recipe to install and configure the infrastructure agent, logs, and APM. If this recipe detects an unsupported platform or version, the Chef run fails. Configuration depends on your specific setup and standards.

> #### ⚠️ IMPORTANT
>
> This cookbook will always install the latest released version of the New Relic agent and doesn't support installing older versions.

## Set up New Relic with Chef [#recipe-setup]

The `newrelic_install` resource manager will instrument New Relic using our [guided install](https://one.newrelic.com/marketplace/install-data-source?state=54fb0241-f38f-ac22-f941-6566d771b6f4), with minimal configuration. It will:

-   Set any attributes necessary for your desired configuration
-   Add the `newrelic-install::default` recipe your run list

### Run `newrelic-install` recipe [#execution]

```ruby
newrelic_install 'install' do
  action                   :install
  new_relic_api_key        node['newrelic_install']['NEW_RELIC_API_KEY']
  new_relic_account_id     node['newrelic_install']['NEW_RELIC_ACCOUNT_ID']
  env                      node['newrelic_install']['env']
  targets                  node['newrelic_install']['targets']
end
```

## Chef attributes [#attributes]

The `default` recipe supplies the following Chef attributes:

| Name                                                  | IsRequired | Description                                                                                                                                                                             |
| ----------------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `default['newrelic_install']['NEW_RELIC_API_KEY']`    | Required   | Your New Relic [user key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys).                                                                                           |
| `default['newrelic_install']['NEW_RELIC_ACCOUNT_ID']` | Required   | The [New Relic account ID](https://docs.newrelic.com/docs/accounts/accounts-billing/account-structure/account-id)                                                                       |
| `default['newrelic_install']['targets']`              | Required   | List of targeted installs to run on hosts. Available options are: - `infrastructure-agent-installer` - `logs-integration` - `php-agent-installer`                                       |
| `default['newrelic_install']['NEW_RELIC_REGION']`     | Optional   | The [data center region](https://docs.newrelic.com/docs/accounts/accounts-billing/account-setup/choose-your-data-center) for your organization (`US`, `EU`, or `JP`). Defaults to `US`. |
| `default['newrelic_install']['env']['HTTPS_PROXY']`   | Optional   | Sets the proxy server the agent should use.                                                                                                                                             |
| `default['newrelic_install']['verbosity']`            | Optional   | Specifies command output verbosity Supported values include - `debug` - `trace`                                                                                                         |
| `default['newrelic_install']['tags']`                 | Optional   | Key value pair tags added through custom attributes.                                                                                                                                    |
| `default['newrelic_install']['timeout_seconds']`      | Optional   | Sets the timeout in seconds for New Relic installations. Defaults to `600`.                                                                                                             |

**PHP Agent**

-   `default['newrelic_install']['env']['NEW_RELIC_APPLICATION_NAME']` (optional) The name of the PHP application to instrument. This name will be listed under New Relic's `APM & Services`. If omitted, defaults to `PHP Application`.
