---
title: "How to Install & Troubleshoot With the Netdata Monitoring Tool"
description: "Learn how to install the Netdata monitoring tool on your server and save yourself the headache of troubleshooting applications and services!"
canonical: "https://adamtheautomator.com/netdata/"
---

# How to Install & Troubleshoot With the Netdata Monitoring Tool

> Learn how to install the Netdata monitoring tool on your server and save yourself the headache of troubleshooting applications and services!

Source: https://adamtheautomator.com/netdata/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![How to Install & Troubleshoot With the Netdata Monitoring Tool](https://adamtheautomator.com/wp-content/uploads/2022/02/How-to-Install-Troubleshoot-With-the-Netdata-Monitoring-Tool.jpg)

# How to Install & Troubleshoot With the Netdata Monitoring Tool

[![](https://secure.gravatar.com/avatar/572a248f516b6d0cd566cb44fdbd9336f30ef95aa0f6d78f118c1f47b1b6d6b7?s=192&d=mm&r=g)Arvid Larson](https://adamtheautomator.com/author/arvid-larson/)17 February 20229 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[NetData](/tag/netdata/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Installing the Netdata Monitoring Tool](#installing-the-netdata-monitoring-tool)
*   [Setting up NGINX as a Reverse Proxy for Netdata](#setting-up-nginx-as-a-reverse-proxy-for-netdata)
*   [Setting up Slack Notification for Netdata](#setting-up-slack-notification-for-netdata)
*   [Setting up Notifications for your Application](#setting-up-notifications-for-your-application)
*   [Setting up Monitoring for NGINX Service](#setting-up-monitoring-for-nginx-service)
*   [Setting up Monitoring for MariaDB Server](#setting-up-monitoring-for-mariadb-server)
*   [Monitoring PHP-FPM with Netdata](#monitoring-php-fpm-with-netdata)
*   [Conclusion](#conclusion)

If you’re a VPS (Virtual Private Server) owner and seeking a VPS monitoring tool, give Netdata a try. Netdata automatically monitors servers and applications installed on your server in real-time.

In this article, you’ll learn how to set up Netdata on the Linux server so you can monitor your system and application in real-time.

Read on to start monitoring your Linux server!

## Prerequisites

This post will be a step-by-step tutorial. To follow along, be sure you have the following:

*   A Linux server – This tutorial uses the Ubuntu 20.04 server.

Related:[How to Install Ubuntu 20.04 \[Step-by-Step\]](https://adamtheautomator.com/install-ubuntu/)

*   A non-root user with `sudo` privileges.
    
*   A [Slack](https://slack.com/) account and workspace for notification.
    

## Installing the Netdata Monitoring Tool

Netdata is a flexible monitoring tool that you can install on your Linux server, which detects services and monitor your system automatically — good deal, huh? But how do you set up Netdata? By running a one-line command installer script.

> _The main advantage of installing Netdata from the official repository is you can always get the latest version with the latest features and patches_

1\. Open your terminal and SSH to your server.

2\. Next, run the below command to download and run the Netdata installer script (`https://my-netdata.io/kickstart.sh`) to install Netdata on your system.

```bash
bash <(curl -Ss https://my-netdata.io/kickstart.sh)
```

3\. Enter **Y**, as shown below, to confirm adding the Netdata repository to your system.

![Adding Netdata Repository](https://adamtheautomator.com/wp-content/uploads/2022/02/image-212.png)

Adding Netdata Repository

4\. Type **Y** to confirm and install Netdata to your system on the following prompt.

![Installing Netdata on Ubuntu system](https://adamtheautomator.com/wp-content/uploads/2022/02/image-213.png)

Installing Netdata on Ubuntu system

5\. Lastly, run the 

As you see below, the **netdata** service is **active (running)** and **enabled**. From now on, the `netdata` service will start automatically on system startup.

![Starting, enabling, and verifying Netdata Service](https://adamtheautomator.com/wp-content/uploads/2022/02/image-214.png)

Starting, enabling, and verifying Netdata Service

Additionally, run the below command to get the list of open ports on your Linux system.

```bash
ss -plnt
```

You should see that port 19999 is on the LISTEN state and is used by the netdata service.

![Checking Open Ports](https://adamtheautomator.com/wp-content/uploads/2022/02/image-215.png)

  
Checking Open Ports

## Setting up NGINX as a Reverse Proxy for Netdata

After installing Netdata on your Linux server, you’ll now set up NGINX as a reverse proxy for Netdata. Doing so prevents Netdata from being exposed to the internet directly, securing your Netdata installation.

> _If you’ve already installed NGINX on your server, you can skip the installation part (step one) and continue to the following steps. But, you may follow the_ _[Netdata Documentation](https://learn.netdata.cloud/docs/agent/running-behind-apache) if you prefer to use Apache for reverse proxy._

1\. Run the `apt` command below to `install nginx` packages on your server.

```bash
sudo apt install nginx -y
```

2\. Next, edit the server block configuration _/etc/nginx/sites-available/default_ using your preferred editor and populate the following configuration.

Put the upstream {..} section on top of the server {..} block. Doing so defines the netdata proxy\_pass to 127.0.0.1:19999;.

```powershell
# Define netdata upstream
upstream netdata {
    server 127.0.0.1:19999;
    keepalive 64;
}
```

![Setting up Netdata Upstream for Reverse Proxy](https://adamtheautomator.com/wp-content/uploads/2022/02/image-216.png)

Setting up Netdata Upstream for Reverse Proxy

3\. Now put the `location {..}` section inside the `server {..}` block configuration. This configuration makes the Netdata accessible in path URL `/netdata/`.

```powershell

# Location for netdata
	location = /netdata {
		  return 301 /netdata/;

# Reverse proxy configuration
	location ~ /netdata/(?<ndpath>.*) {
		  proxy_redirect off;
      proxy_set_header Host $host;

      proxy_set_header X-Forwarded-Host $host;
      proxy_set_header X-Forwarded-Server $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_http_version 1.1;
      proxy_pass_request_headers on;
      proxy_set_header Connection "keep-alive";
      proxy_store off;
      proxy_pass http://netdata/$ndpath$is_args$args;

      gzip on;
      gzip_proxied any;
      gzip_types *;
}
```

![Setting up NGINX Reverse Proxy for Netdata](https://adamtheautomator.com/wp-content/uploads/2022/02/image-217.png)

Setting up NGINX Reverse Proxy for Netdata

4\. Now, run the below commands to verify the NGINX configuration and restart the NGINX service.

```bash
# Verify NGINX configuration
sudo nginx -t

# Restart NGINX service
sudo systemctl restart nginx
```

If your configuration is correct, you’ll see an output message, such as syntax is ok.

![Verifying NGINX Configuration and Restarting NGINX Service](https://adamtheautomator.com/wp-content/uploads/2022/02/image-218.png)

Verifying NGINX Configuration and Restarting NGINX Service

Related:[How to Test Your NGINX Configuration Before Screwing it Up](https://adamtheautomator.com/nginx-test-config/)

5\. Lastly, open your web browser, and navigate to your server IP address followed by the path URL /netdata (i.e., http://172.16.1.20/netdata\*) to access the Netdata monitoring dashboard.

![Accessing the Netdata Dashboard](https://adamtheautomator.com/wp-content/uploads/2022/02/image-219.png)

Accessing the Netdata Dashboard

## Setting up Slack Notification for Netdata

Apart from an informative dashboard, Netdata also supports alerting/notifications with Slack. Notification is one of the most critical aspects of monitoring as they warn you of any problem that occurs on your server.

So after you’ve configured NGINX reverse proxy, you’ll set up a notification for Netdata using Slack. Setting up Slack as a notification for Netdata allows you to organize notifications about your server in a specific channel.

1\. Navigate to [Slack API](https://api.slack.com/apps) on your web browser and click on **Create App** to choose how you want to start creating an app.

![Slack App](https://adamtheautomator.com/wp-content/uploads/2022/02/image-220.png)

2\. Next, choose the **From scratch** option, and a pop-up window appears where you’ll name the app and choose a workspace.

![Choosing to create an app from scratch](https://adamtheautomator.com/wp-content/uploads/2022/02/image-221.png)

Choosing to create an app from scratch

3\. Enter a name for the app, select your workspace, and click on **Create App** to create the app.

For this demo, the app is netdata, while the workspace is set to workingtest, as shown below.

![Setting Name and Workspace for the new app in Slack](https://adamtheautomator.com/wp-content/uploads/2022/02/image-222.png)

Setting Name and Workspace for the new app in Slack

4\. After creating the app, configure incoming webhooks with the following:

*   Click the **Incoming Webhook** menu under **Features**
    
*   Activate the webhook, then click the **Add New Webhook to Workspace** button. Your browser automatically redirects to a new page asking where Netdata should post notifications.
    
*   Select the channel target for notification and click **Allow**. This example uses the **monitoring** slack channel for notification.
    
*   Copy the webhook URL to your note, and you’ll use it in the next step.
    

![Enabling and Creating Webhook](https://adamtheautomator.com/wp-content/uploads/2022/02/image-223.png)

Enabling and Creating Webhook

5\. Now, move back to your terminal and run the commands below to create a new notification configuration named `health_alarm_notify.conf` using the `edit-config` script. The `edit-config` script is a helper provided by Netdata for editing its configuration.

> _The `edit-script` is available at the `/etc/netdata` directory. The script automatically copies configurations from the /usr/lib/netdata/conf.d directory to the target file you want to create, then opens the file with your default editor._

```bash
# Navigate to /etc/netdata 
cd /etc/netdata/

# Creates notification configuration file
# Opens the config file to your default text editor
./edit-config health_alarm_notify.conf
```

6\. Configure the _health\_alarm\_notify.conf_ file with the following to set the app’s notification behavior:

*   Ensure the `SEND_SLACK` option’s value is set to `YES` to enable slack notification.
    
*   Input your slack webhook URL you noted previously (step four) to the `SLACK_WEBHOOK_URL` option.
    
*   Input the channel for notification at the `DEFAULT_RECIPIENT_SLACK` option.
    
*   Save the changes and exit the editor.
    

```powershell
# Enable slack notification
SEND_SLACK="YES"

# Select the slack webhook
SLACK_WEBHOOK_URL="https://hooks.slack.com/services/xxxxxxx"

# Default channel for notification
DEFAULT_RECIPIENT_SLACK="monitoring"
```

![Setting up Slack notification for Netdata](https://adamtheautomator.com/wp-content/uploads/2022/02/image-224.png)

Setting up Slack notification for Netdata

7\. Now, run the below command to `restart` the `netdata` service and apply the new configuration from the _health\_alarm\_notify.conf_ file.

```bash
# Restart Netdata
sudo systemctl restart netdata
```

![Setting up Slack Notification for Netdata and Restarting Netdata Service](https://adamtheautomator.com/wp-content/uploads/2022/02/image-225.png)

Setting up Slack Notification for Netdata and Restarting Netdata Service

8\. Lastly, run the commands below to test if the new configuration works. The `alarm-notify.sh` script sends a test message to the Slack channel for notification.

```bash
# Login to netdata user
sudo su -s /bin/bash netdata

# Executes alarm-notify.sh script to test notification
# The script sends a test message to the Slack channel for notification
/usr/libexec/netdata/plugins.d/alarm-notify.sh test
```

You’ll get an output on the terminal screen similar to the one below if your configuration works correctly.

![Testing Slack Notification](https://adamtheautomator.com/wp-content/uploads/2022/02/image-226.png)

Testing Slack Notification

You’ll receive a message on the slack channel like in the screenshot below.

![Testing Netdata notification to Slack Channel](https://adamtheautomator.com/wp-content/uploads/2022/02/image-227.png)

Testing Netdata notification to Slack Channel

## Setting up Notifications for your Application

You’ve already configured Slack notification, but is that enough to monitor your application? Why not set up notifications for your application? For instance, setting up notifications for your application notifies you in Slack whenever CPU usage reaches a certain point.

1\. Run the commands below to create a new configuration file called `health.d/cpu.conf` using the `edit-config` script.

```bash
# Navigate to /etc/netdata
cd /etc/netdata/

# Create custom CPU notification
# Copy the cpu.conf file from the /usr/lib/netdata/conf.d/health.d directory 
# to your new file (health.d/cpu.conf).
./edit-config health.d/cpu.conf
```

In the _cpu.conf_ file, change the value of the warn and crit options with the following lines, save the changes and exit the editor.

With this configuration, whenever the server CPU usage is between 60% – 70% in the last 10 minutes, you’ll get the warning notification. But when the CPU usage is 75% – 85%, you’ll get the critical notification instead.

```powershell
    warn: $this > (($status >= $WARNING)  ? (60) : (70))
    crit: $this > (($status == $CRITICAL) ? (75) : (85))
```

![Setup Notification for High CPU usage](https://adamtheautomator.com/wp-content/uploads/2022/02/image-228.png)

Setup Notification for High CPU usage

2\. Next, run the below command to restart the `netdata` service and apply the new configuration from the _cpu.conf_ file.

```bash
sudo systemctl restart netdata
```

3\. Run the below command to install the stress tool, which you’ll use to test your CPU usage notification.

```bash
sudo apt install stress -y
```

4\. Now, run the [`stress`](https://linux.die.net/man/1/stress) command below to get max usage on your CPU. Be sure to change the number (`2`) with your CPUs. This command lets you test if the high CPU usage notification works.

Leave this command running for two to three minutes until you get a notification on the Slack channel, then [stop the command](https://www.cyberciti.biz/faq/how-to-stopinterrupt-cp-or-mv-linux-or-unix-command/) by pressing Ctrl+C.

```bash
# running cpu stressing tool
stress --cpu 2
```

5\. Lastly, check your Slack channel, and you’ll see a notification from your server about the high CPU usage. After a few minutes, you’ll get the notification that the server has recovered.

![Viewing Sent Notification to Slack about High CPU Usage](https://adamtheautomator.com/wp-content/uploads/2022/02/image-229.png)

Viewing Sent Notification to Slack about High CPU Usage

## Setting up Monitoring for NGINX Service

Apart from setting up a notification for CPU usage, you can also set up monitoring for the NGINX service using Netdata. You’ll set up the `ngx_http_stub_status_module` NGINX module, then Netdata automatically detects to monitor the NGINX service’s performance.

> _Netdata uses different types of plugins to monitor your system automatically. These plugins are the internal plugin to gather system metrics, the external plugins to gather non-system metrics, and the orchestrator. Some [Netdata plugins](https://learn.netdata.cloud/docs/agent/collectors/collectors) are written in Go, Bash, Python, and NodeJS._

1\. Open the default virtual host configuration (`/etc/nginx/sites-available/default`) in your preferred editor.

Populate the following configuration inside the server {…} section. This configuration enables ngx\_http\_stub\_status\_module and allows Netdata to gather metrics to monitor NGINX.

```powershell
# Enable module stub_status
location /stub_status {
		stub_status;
    allow 127.0.0.1;        #only allow requests from localhost
    deny all;               #deny all other hosts
}
```

![Enabling NGINX stub\_status Module](https://adamtheautomator.com/wp-content/uploads/2022/02/image-230.png)

Enabling NGINX stub\_status Module

2\. Next, run the below commands to verify the NGINX configuration and restart the NGINX service and the netdata service.

```bash
# Verify NGINX configuration
sudo nginx -t

# Restart nginx
sudo systemctl restart nginx

# Restart Netdata
# Makes the Netdata service re-discover services on your system
# and monitor the NGINX service.
sudo systemctl restart netdata
```

3\. Lastly, switch back to your web browser and reload the Netdata dashboard.

If all goes well, you’ll see the new nginx local monitoring section on the Netdata dashboard, as shown below.

![Monitoring NGINX Service with Netdata](https://adamtheautomator.com/wp-content/uploads/2022/02/image-231.png)

Monitoring NGINX Service with Netdata

## Setting up Monitoring for MariaDB Server

Databases are a vital element for applications. Measuring and monitoring the database backend allows you to get statistics about your database performance and minimize your application’s downtime. Database performance also always affects application performance, speed, and availability.

You’ll take advantage of the Netdata Python plugins to monitor the MariaDB server, but you’ll first install the `mysqlclient` Python driver.

1\. Run the following `apt` command to install some packages dependencies for installing the `mysqlclient` Python driver.

```bash
sudo apt install -y python3-pip python3-dev python3-pip default-libmysqlclient-dev build-essential
```

2\. Next, run the `pip` command below to install the `mysqlclient` module.

```bash
pip install mysqlclient
```

![Installing mysqlclient Module for Python](https://adamtheautomator.com/wp-content/uploads/2022/02/image-232.png)

Installing mysqlclient Module for Python

3\. Run the `mysql` command below to log in to the MariaDB server.

```bash
mysql -u root -p
```

![Logging in to MariaDB Server](https://adamtheautomator.com/wp-content/uploads/2022/02/image-233.png)

Logging in to MariaDB Server

4\. Execute the MariaDB queries below to create a new user `netdata` with permissions for monitoring the MariaDB server. After running the queries, the `netdata` user cannot alter any databases on the MariaDB server.

```sql
# create new MariaDB user netdata
create user 'netdata'@'localhost';

# grant permission for user netdata to collecting MariaDB statistics 
grant usage, replication client on *.* to 'netdata'@'localhost';

# reload tables privileges to apply new changes
flush privileges;

# log out from MariaDB shell
exit
```

![Creating new MariaDB user for Netdata](https://adamtheautomator.com/wp-content/uploads/2022/02/image-234.png)

Creating new MariaDB user for Netdata

5\. Now, run the following command to restart the `netdata` service.

```bash
sudo systemctl restart netdata
```

6\. Lastly, switch back to your web browser and refresh the Netdata dashboard. You’ll see the `MySQL local` menu on the right panel, which indicates Netdata is already monitoring your MariaDB server.

![Monitoring MariaDB with Netdata](https://adamtheautomator.com/wp-content/uploads/2022/02/image-235.png)

Monitoring MariaDB with Netdata

## Monitoring PHP-FPM with Netdata

Monitoring the PHP-FPM service allows you to track the PHP-FPM that handles your PHP applications’ active connection, requests, and performance.

You’ll be setting up the PHP-FPM status page to monitor the PHP-FPM with the Netdata.

1\. Open the _/etc/php/7.4/fpm/pool.d/www.conf_ configuration using your preferred editor and uncomment the **pm.status\_path = /status** option. Doing so enables the PHP-FPM status.

![Enabling PHP-FPM monitoring status](https://adamtheautomator.com/wp-content/uploads/2022/02/image-236.png)

Enabling PHP-FPM monitoring status

2\. Next, edit the default NGINX server block (_/etc/nginx/sites-available/default_) using your preferred editor and populate the following configuration inside the `server {...}` section.

This configuration allows Netdata to discover the PHP-FPM status page on the http://localhost/status URL.

```powershell
# define PHP-FPM monitoring
location ~ ^/(status|ping)$ {
    allow 127.0.0.1;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_pass   unix:/run/php/php7.4-fpm.sock;
}
```

![Enabling PHP-FPM Status module](https://adamtheautomator.com/wp-content/uploads/2022/02/image-237.png)

Enabling PHP-FPM Status module

3\. Run each command below to restart the PHP-FPM (`php7.4-fpm`) and `nginx` service. These commands also apply new changes to both services.

```bash
# Restart PHP-FPM
sudo systemctl restart php7.4-fpm

# Restart NGINX
sudo systemctl restart nginx
```

4\. Now, run the following command to restart the `netdata` service. Netdata will automatically re-discover services for monitoring.

```bash
sudo systemctl restart netdata
```

5\. Lastly, switch back to your web browser and reload the Netdata dashboard.

If your configuration is correct, you’ll see the PHP-FPM local menu, which details monitoring for PHP-FPM service.

![Monitoring PHP-FPM Netdata](https://adamtheautomator.com/wp-content/uploads/2022/02/image-238.png)

Monitoring PHP-FPM Netdata

## Conclusion

Throughout this tutorial, you’ve learned how to install Netdata on the Ubuntu Linux system. You’ve also learned how to integrate Slack notification for Netdata monitoring for the NGINX web server, MariaDB database, and PHP-FPM.

At this point, you’ve fully configured the Netdata monitoring tool to keep a close watch on your application and services. What’s next for you? Perhaps [set up a notification](https://learn.netdata.cloud/docs/agent/health/reference) for your application monitoring?

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fnetdata%2F&text=How%20to%20Install%20%26%20Troubleshoot%20With%20the%20Netdata%20Monitoring%20Tool)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fnetdata%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fnetdata%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2026/07/featured_image-4.png)

### [Migrate from EWS to Microsoft Graph API](/migrate-ews-microsoft-graph-api/)

Move EWS mailbox automation to Microsoft Graph with a practical inventory, permissions, PowerShell SDK, and cutover validation checklist.

![](https://adamtheautomator.com/wp-content/uploads/2026/06/featured_image-21.png)

### [Automate SOC 2 Compliance with PowerShell](/automate-soc-2-compliance-powershell/)

A comprehensive walkthrough on using PowerShell and Azure Policy as Code to automate evidence collection and enforce SOC 2 compliance controls across enterprise cloud environments.

![](https://adamtheautomator.com/wp-content/uploads/2026/06/26995-troubleshoot-dns-issues-powershell-codex.webp)

### [Troubleshoot DNS Issues with PowerShell](/troubleshoot-dns-issues-powershell/)

Troubleshoot DNS issues with PowerShell by testing name resolution, DNS client settings, cache entries, and network connectivity in a repeatable workflow.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
