---
title: Install the Ruby agent on Heroku
source: https://docs.newrelic.com/docs/apm/agents/ruby-agent/installation/ruby-agent-heroku
---

Install the New Relic Ruby agent on Heroku using the New Relic add-on.

## Prerequisites [#prerequisites]

| Requirement           | Details                                                                                                                                                                                           |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **New Relic account** | A New Relic account is created automatically when you install the Heroku add-on.                                                                                                                  |
| **Heroku account**    | A [Heroku](https://www.heroku.com/) account with your Ruby app already deployed.                                                                                                                  |
| **Ruby version**      | See [Ruby agent requirements and supported frameworks](https://docs.newrelic.com/docs/apm/agents/ruby-agent/getting-started/ruby-agent-requirements-supported-frameworks) for supported versions. |

## Install the New Relic add-on [#install]

### Heroku website

1.  Go to [Heroku's Add-on page for New Relic](https://elements.heroku.com/addons/newrelic#pricing) and select a subscription plan.
2.  Under **Select an app**, select your app.
3.  Click **Submit Order Form**.

### Heroku toolbelt

Run the following command, replacing `$planlevel` with the [appropriate subscription plan](https://elements.heroku.com/addons/newrelic#pricing):

````bash
heroku addons:create newrelic:$planlevel
```

````

Installing the add-on automatically creates a New Relic account and configures access for Heroku hosts.

## Configure the agent [#configure]

Add the `newrelic_rpm` gem to your `Gemfile`:

````ruby
gem 'newrelic_rpm'
```

Set your app name using the Heroku toolbelt:

```bash
heroku config:set NEW_RELIC_APP_NAME='Your Application Name'
```

The license key is set automatically by the add-on. For all other configuration options, see [Ruby agent configuration](/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration).

````

## Verify data is flowing [#verify]

Restart your dyno and generate some traffic to your app:

````bash
heroku restart
```

Wait 2–3 minutes and open [one.newrelic.com > APM](https://one.newrelic.com/apm) to look for your app by name.

<Callout variant="tip">
  App not appearing? See [No data appears (Ruby)](/docs/apm/agents/ruby-agent/troubleshooting/no-data-appears-ruby).
</Callout>

````

## Related articles [#related-docs]

-   [Ruby agent requirements and supported frameworks](https://docs.newrelic.com/docs/apm/agents/ruby-agent/getting-started/ruby-agent-requirements-supported-frameworks) — Supported Ruby versions.
-   [Ruby agent configuration](https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration) — All available configuration settings.
-   [Heroku add-on for New Relic](https://elements.heroku.com/addons/newrelic) — Subscription plans and pricing.
