27 C
Texas
angeloma
Senior Writer and partner

How to install Netdata on Ubuntu 20.04 / Debian 10

Servers are usually the most important part of a network, monitoring and knowing what their performance is is an essential task of any system administrator. They must therefore ensure that they use efficient tools to meet certain objectives. That is why, today you will learn to install Netdata on Ubuntu 20.04 / Debian 10.

Netdata is a tool to visualize and monitor metrics in real time, optimized to accumulate all types of data. It is also optimized to accumulate all types of data, such as CPU usage, disk activity, SQL queries, website visits, etc. The tool is designed to visualize the now in as much detail as possible, allowing the user to get an overview of what is happening and what has just happened in your system or application.

Netdata is very easy to use

For the server monitoring conception conceived by Netdata, it is vital that everything is monitorable. It also has the following attributes.

  • Out of the box: netdata supports auto-detection for everything. It collects more than 5000 metrics automatically, with zero configuration
  • Basically, it can monitor practically in real time and achieves this without sacrificing performance in its execution.
  • It is highly customizable thanks to HTML.
  • Extensible: Anything you can get a number for, can be given to netdata, using its Plugin API.
  • Scalable: netdata scales out, your web browser is the central netdata connecting all your servers together

Install Netdata on Ubuntu 20.04 / Debian 10

One of the main advantages of Netdata is that we can install it using the official Ubuntu repositories. This, apart from being secure, will give us the necessary stability in this kind of procedure.

- Advertisement -

So, open a terminal or SSH session.

When you start it, it updates Ubuntu completely.

sudo apt update
sudo apt upgrade

Once the system is fully upgraded, you can install Netdata by running the following command:

sudo apt install netdata

Netdata is also managed as a system service, so you can use the systemctl command to start it, stop it, or check its status.

Netdata is now available from http://localhost:19999 but you may want to configure Nginx as a reverse proxy.

Configuring Nginx as reverse proxy for Netdata

First, install Nginx from the Ubuntu repositories.

sudo apt install nginx

Next, create a new configuration file for Netdata

sudo nano /etc/nginx/conf.d/netdata.conf

And add the following:

upstream backend {
# the Netdata server
server 127.0.0.1:19999;
keepalive 64;
}
server {
# nginx listens to this
listen 80;
# the virtual host name of this
server_name angtest.ga;

    location / {
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_pass http://backend;
proxy_http_version 1.1;   
proxy_pass_request_headers on;
proxy_set_header Connection "keep-alive";
proxy_store off;
}
}
Configuring Nginx for Netdata
Configuring Nginx for Netdata

Replace server_name with the name of your server.

It is also a good idea to secure your Netdata installation by installing and adding certificates to enable HTTPS.

So, install Certbot.
sudo apt install certbot python3-certbot-nginx

And create the new certificate for your domain by running:

sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email [email protected] -d your-domain

Replace the email and -d values with your own.

Finally, restart Nginx.

sudo systemctl restart nginx

Using Netdata

Now you can open netdata from your web browser by opening https://your-domain and you will see the dashboard.

Netdata on Ubuntu 20.04 / Debian 10
Netdata on Ubuntu 20.04 / Debian 10

After that, just check the options on the left side of the screen.

So, enjoy it.

Conclusion

About Netdata you can say that it’s amazing how easy it is to use. Also, the app is really an Out-The-Box application because you simply don’t have to configure anything extra, it’s just install and go

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

2 COMMENTS

  1. Hello. I Have this problem:

    sudo certbot –nginx –agree-tos –redirect –hsts –staple-ocsp –email [email protected] -d Netdata
    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    Error while running nginx -c /etc/nginx/nginx.conf -t.

    nginx: [emerg] invalid parameter “server_name” in /etc/nginx/conf.d/netdata.conf:12
    nginx: configuration file /etc/nginx/nginx.conf test failed

    The nginx plugin is not working; there may be problems with your existing configuration.
    The error was: MisconfigurationError(‘Error while running nginx -c /etc/nginx/nginx.conf -t.\n\nnginx: [emerg] invalid parameter “server_name” in /etc/nginx/conf.d/netdata.conf:12\nnginx: configuration file /etc/nginx/nginx.conf test failed\n’)

    My netdata.conf:

    upstream backend {
    # the Netdata server
    server 127.0.0.1:12999;
    keepalive 64;
    }

    server {
    # nginx listens to this
    listen 80

    # the virtual host name of this
    server_name C4.netfree;

    location / {
    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_pass http://backend;
    proxy_http_version 1.1;
    proxy_pass_request_headers on;
    proxy_set_header Connection “keep-alive”;
    proxy_store off;
    }
    }

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article