How To Install New Relic Monitoring on RunCloud

install new relic on runcloud header image

New Relic is a great performance testing & monitoring tool. In this guide, we’ll show you how to deploy New Relic connected to your RunCloud account. 

So, without further ado – let’s dive right in. 

1. Sign Up For a New Relic Account

new relic homepage

Before we can install New Relic on your server, you’ll need to go ahead and create an account over on their website. They know to offer a free plan so you can get started with that plan if you’re just looking to experiment with the insights that their platform can give you. 

2. Select Your Installation Environment

Once you’ve finished creating & verifying your account, you’ll be prompted to choose an “Installation Plan”. Here, you’ll want to select Auto-discovery and choose Linux:

new relic installation environment

3. SSH Into Your Server

Now, SSH into your server. You will need to do so using a user that has sudo privileges.

ssh root@[your server ip]

When prompted enter your password. 

4. Run The New Relic Installation Script

And then, once you’ve successfully logged in – run the installation command provided in New Relic’s dashboard which will look something like this:

curl -Ls https://download.newrelic.com/install/newrelic-cli/scripts/install.sh | bash && sudo NEW_RELIC_API_KEY=NRAK-3MMAZZJ6Q02ASQXBDPSJWGUWMPC NEW_RELIC_ACCOUNT_ID=3375405 /usr/local/bin/newrelic install

The New Relic installation process will then begin.

new relic installation process started

Which will start with validating the connectivity to the New Relic platform…

At this stage then proceed by clicking enter to perform the guided install that will automatically discover and recommend the integrations appropriate for your web application. This will also add the infrastructure and log data that will be extremely useful for performance monitoring.

new relic installation integration options
Would you like to tail those log files to New Relic Y/N (default: Y)

When asked, respond with Y (if you would like to bring existing log files into New Relic as well).

Would you like to be notified on your registered email address when this alert triggers Y/N (default: Y)?

When asked the above, you can again respond with Y which is the default if you wish to receive notifications at your registered email address. Otherwise, simply respond with N (followed by the enter key).

What is the name of your PHP application? (Double-quote (“) is not a valid character in the name)?

When asked what the name of the web application on your server is, enter the name of the web application (as it is set in RunCloud and as is, therefore, the directory).

Do you want to install the PHP Agent Y/N (default: Y) 

When prompted with the following question, respond with Y.

5. Update New Relic Installation Path to Match RunCloud PHP Directory

And now, since RunCloud uses its own version of PHP – you need to set the New Relic installation path to match RunCloud’s PHP path. Do so by running the following command:

NR_INSTALL_PATH=/RunCloud/Packages/php7*rc/bin; export NR_INSTALL_PATH
newrelic-install

After which you will be prompted to enter your New Relic license key, which can be found by navigating to your New Relic dashboard and then the API Keys page.

new relic dashboard api keys

Among the list of API keys here, you will see one with a note stating that it is the “original account license key” as shown below:

new relic original account licence keys

Click the three horizontal dots, and then select copy account key:

new relic api key copy account key

And then navigate back to your terminal window to paste the license key. 

After which you will be asked to select which directories/versions to select, as follows:

Below is a list of the directories in which we found a copy of PHP.
Please select the directory or directories for which you wish to install
New Relic. You can select either a single directory or
multiple directories by separating each choice with either a space or a
comma. To select all of the directories shown, please enter the special
keyword 'all' (without the quotes).
   1)   /usr/bin
   2)   /bin
   3)   /RunCloud/Packages/php72rc/bin
   4)   /RunCloud/Packages/php73rc/bin
   5)   /RunCloud/Packages/php74rc/bin
   0)   Exit
   Selection (1-5, 0 to exit or all): all

Respond with the keyword “all” (without the double quotations), as shown above and the New Relic installer will be able to discover all instances of PHP on the server.  

After which you will see a success message that reads as follows:

New Relic is now installed on your system. Congratulations!

Which, to be certain that all of the latest changes have been applied and have taken effect you can run the following command:

systemctl reload php7*rc-fpm
new relic dashboard after installation

And that’s it – you’re all set! Your New Relic account will now be collecting data and monitoring your server. If you have any questions for us, feel free to leave a comment! 💬

Categories: Server Management

Simplifying Server Management

RunCloud is a cloud server management tool that allows you to maintain full control of your server and host multiple WordPress, WooCommerce, Laravel, and PHP applications with fast and easy configuration.

Start Your Free Trial

5 days free trial no credit card required cancel anytime

Leave a Comment

Your email address will not be published. Required fields are marked *