{"id":6701,"date":"2020-08-16T11:13:09","date_gmt":"2020-08-16T08:13:09","guid":{"rendered":"https:\/\/kifarunix.com\/?p=6701"},"modified":"2024-03-14T22:34:05","modified_gmt":"2024-03-14T19:34:05","slug":"install-and-setup-netdata-on-ubuntu-20-04-18-04","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-and-setup-netdata-on-ubuntu-20-04-18-04\/","title":{"rendered":"Install and Setup NetData on Ubuntu 20.04\/18.04"},"content":{"rendered":"\n

In this tutorial, you will learn how to install and setup NetData on Ubuntu 20.04\/18.04. NetData<\/a> is a free and open source, distributed, real-time performance and health monitoring tool for systems and applications. NetData can be installed as an agent on systems\/containers\/applications so as to collect in real time, the system\/container\/application metrics and displays them on an interactive web interface. It can store all these metrics for a predefined time period. It can be integrated with other monitoring tools such as Prometheus, Graphite, OpenTSDB, Kafka, Grafana, and more.<\/p>\n\n\n\n

Installing NetData on Ubuntu 20.04\/18.04<\/h2>\n\n\n\n

Netdata is a monitoring agent designed to run on all your systems: physical and virtual servers, containers, even IoT\/edge devices. It runs on Linux, FreeBSD, macOS, Kubernetes, Docker, and all their derivatives.<\/p>\n\n\n\n

There are different ways in which you can install NetData on Ubuntu or any other Linux\/Unix systems as outlined on the NetData installation guide.<\/p>\n\n\n\n

Note that NetData is available on both Ubuntu 20.04 and Ubuntu 18.04 Universe repos.<\/p>\n\n\n\n

Ubuntu 20.04;<\/p>\n\n\n\n

apt show netdata<\/code><\/pre>\n\n\n\n
Package: netdata\nVersion: 1.19.0-3ubuntu1\nPriority: optional\nSection: universe\/net\nOrigin: Ubuntu\nMaintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>\nOriginal-Maintainer: Lennart Weller <lhw@ring0.de>\nBugs: https:\/\/bugs.launchpad.net\/ubuntu\/+filebug\nInstalled-Size: 38.9 kB\nDepends: netdata-core | netdata-core-no-sse, netdata-plugins-bash, netdata-web\nRecommends: netdata-plugins-nodejs, netdata-plugins-python\nHomepage: https:\/\/github.com\/netdata\/netdata\nDownload-Size: 8,156 B\nAPT-Sources: http:\/\/ke.archive.ubuntu.com\/ubuntu focal\/universe amd64 Packages\nDescription: real-time performance monitoring (metapackage)\n<\/code><\/pre>\n\n\n\n

Ubuntu 18.04;<\/p>\n\n\n\n

apt show netdata<\/code><\/pre>\n\n\n\n
Package: netdata\nVersion: 1.9.0+dfsg-1\nPriority: optional\nSection: universe\/net\nOrigin: Ubuntu\nMaintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>\nOriginal-Maintainer: Lennart Weller <lhw@ring0.de>\nBugs: https:\/\/bugs.launchpad.net\/ubuntu\/+filebug\nInstalled-Size: 2,214 kB\nDepends: adduser, libcap2-bin (>= 1:2.0), lsb-base (>= 3.1-23.2), netdata-data (= 1.9.0+dfsg-1), python3, python3-urllib3, python3-yaml, libc6 (>= 2.17), libuuid1 (>= 2.16), zlib1g (>= 1:1.1.4)\nRecommends: curl, fping, nodejs\nHomepage: https:\/\/github.com\/firehol\/netdata\nDownload-Size: 502 kB\nAPT-Sources: http:\/\/us.archive.ubuntu.com\/ubuntu bionic\/universe amd64 Packages\n<\/code><\/pre>\n\n\n\n

As you can see, on Ubuntu 20.04, we have NetData v1.19.0 while on Ubuntu 18.04 we have NetData 1.9.0. However, NetData v1.24.0<\/a> is the current release as of this writing.<\/p>\n\n\n\n

Install NetData on Ubuntu 20.04\/18.04 using NetData Automated Installer Script<\/h4>\n\n\n\n

In this tutorial, we will install NetData on Ubuntu 20.04\/Ubuntu 18.04 using the most recommended method as per the NetData installation guide<\/a>. This involves the use of the automatic one-line installation script<\/a> which usually works out of the box on all Linux distributions.<\/p>\n\n\n\n

To use the NetData automated installation script, simply execute the command below;<\/p>\n\n\n\n

Be sure to run the script as an administrative user using a BASH shell.<\/p>\n\n\n\n

bash <(curl -Ss https:\/\/my-netdata.io\/kickstart.sh)<\/code><\/pre>\n\n\n\n

Basically, the script installs NetData from the source code. It therefore downloads and installs all the package dependencies and build tools required to install and run NetData.<\/p>\n\n\n\n

The script runs interactively. Follow the prompts to install NetData on Ubuntu 20.04\/18.04;<\/p>\n\n\n\n

...\n[\/tmp\/netdata-kickstart-2PuU0j\/netdata-v1.24.0-49-gc6ba56af]$ sudo .\/netdata-installer.sh --auto-update \n  ^\n  |.-.   .-.   .-.   .-.   .  netdata                                        \n  |   '-'   '-'   '-'   '-'   real-time performance monitoring, done right!  \n  +----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+--->\n\n\n  You are about to build and install netdata to your system.\n\n  It will be installed at these locations:\n\n   - the daemon     at \/usr\/sbin\/netdata\n   - config files   in \/etc\/netdata\n   - web files      in \/usr\/share\/netdata\n   - plugins        in \/usr\/libexec\/netdata\n   - cache files    in \/var\/cache\/netdata\n   - db files       in \/var\/lib\/netdata\n   - log files      in \/var\/log\/netdata\n   - pid file       at \/var\/run\/netdata.pid\n   - logrotate file at \/etc\/logrotate.d\/netdata\n\n  This installer allows you to change the installation path.\n  Press Control-C and run the same command with --help for help.\n\n\n  NOTE:\n  Anonymous usage stats will be collected and sent to Google Analytics.\n  To opt-out, pass --disable-telemetry option to the installer or export\n  the environment variable DO_NOT_TRACK to a non-zero or non-empty value\n  (e.g: export DO_NOT_TRACK=1).\n\nPress ENTER to build and install netdata to your system > press ENTER\n<\/code><\/pre>\n\n\n\n

Once the installation is done, the script will tell you that it is done and NetData is installed and running;<\/p>\n\n\n\n

...\nnetdata by default listens on all IPs on port 19999,\nso you can access it with:\n\n  http:\/\/this.machine.ip:19999\/\n\nTo stop netdata run:\n\n  systemctl stop netdata\n\nTo start netdata run:\n\n  systemctl start netdata\n\nUninstall script copied to: \/usr\/libexec\/netdata\/netdata-uninstaller.sh\n\n --- Installing (but not enabling) the netdata updater tool --- \nUpdate script is located at \/usr\/libexec\/netdata\/netdata-updater.sh\n\n --- Check if we must enable\/disable the netdata updater tool --- \nAdding to cron\nAuto-updating has been enabled. Updater script linked to: \/etc\/cron.daily\/netdata-updater\n\nnetdata-updater.sh works from cron. It will trigger an email from cron\nonly if it fails (it should not print anything when it can update netdata).\n\n --- Wrap up environment set up --- \nPreparing .environment file\n[\/tmp\/netdata-kickstart-2PuU0j\/netdata-v1.24.0-49-gc6ba56af]# chmod 0644 \/etc\/netdata\/.environment\n OK   \n\nSetting netdata.tarball.checksum to 'new_installation'\n\n --- We are done! --- \n\n  ^\n  |.-.   .-.   .-.   .-.   .-.   .  netdata                          .-.   .-\n  |   '-'   '-'   '-'   '-'   '-'   is installed and running now!  -'   '-'  \n  +----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+--->\n\n  enjoy real-time performance and health monitoring...\n\n OK\n<\/code><\/pre>\n\n\n\n

Refer to NetData installation guide for more installation methods.<\/p>\n\n\n\n

Running NetData As s Service<\/h4>\n\n\n\n

The NetData Kickstart script installs NetData systemd service unit. It also starts and enables NetData service to run on system boot;<\/p>\n\n\n\n

Checking the status;<\/p>\n\n\n\n

systemctl status netdata<\/code><\/pre>\n\n\n\n
\u25cf netdata.service - Real time performance monitoring\n   Loaded: loaded (\/lib\/systemd\/system\/netdata.service; enabled; vendor preset: enabled)\n   Active: active (running) since Sun 2020-08-16 10:18:51 EAT; 13min ago\n  Process: 2141 ExecStartPre=\/bin\/chown -R netdata:netdata \/var\/run\/netdata (code=exited, status=0\/SUCCESS)\n  Process: 2140 ExecStartPre=\/bin\/mkdir -p \/var\/run\/netdata (code=exited, status=0\/SUCCESS)\n  Process: 2139 ExecStartPre=\/bin\/chown -R netdata:netdata \/var\/cache\/netdata (code=exited, status=0\/SUCCESS)\n  Process: 2128 ExecStartPre=\/bin\/mkdir -p \/var\/cache\/netdata (code=exited, status=0\/SUCCESS)\n Main PID: 2142 (netdata)\n    Tasks: 36 (limit: 2317)\n   CGroup: \/system.slice\/netdata.service\n           \u251c\u25002142 \/usr\/sbin\/netdata -P \/var\/run\/netdata\/netdata.pid -D\n           \u251c\u25002181 \/usr\/sbin\/netdata --special-spawn-server\n           \u251c\u25002359 bash \/usr\/libexec\/netdata\/plugins.d\/tc-qos-helper.sh 1\n           \u251c\u25002366 \/usr\/libexec\/netdata\/plugins.d\/go.d.plugin 1\n           \u251c\u25002367 \/usr\/libexec\/netdata\/plugins.d\/apps.plugin 1\n           \u2514\u25002369 \/usr\/libexec\/netdata\/plugins.d\/ebpf.plugin 1\n\nAug 16 10:18:52 ubuntu18.mibeyki.silensec.com netdata[2142]: 2020-08-16 10:18:52: netdata INFO  : MAIN : Found 0 legacy dbengines, setting multidb diskspace to 256MB\nAug 16 10:18:52 ubuntu18.mibeyki.silensec.com netdata[2142]: Created file '\/var\/lib\/netdata\/dbengine_multihost_size' to store the computed value\nAug 16 10:18:52 ubuntu18.mibeyki.silensec.com netdata[2142]: 2020-08-16 10:18:52: netdata INFO  : MAIN :\n<\/code><\/pre>\n\n\n\n

Allow NetData Web Interface External Access<\/h4>\n\n\n\n

NetData by default listens on all IPs on port 19999.<\/p>\n\n\n\n

sudo netstat -altnp | grep :19999<\/code><\/pre>\n\n\n\n
tcp        0      0 0.0.0.0:19999           0.0.0.0:*               LISTEN      2142\/netdata        \ntcp6       0      0 :::19999                :::*                    LISTEN      2142\/netdata<\/code><\/pre>\n\n\n\n

Therefore, to allow external access to NetData web dashboard, you need to open this port on the UFW, if it is running.<\/p>\n\n\n\n

sudo ufw allow 19999\/tcp<\/code><\/pre>\n\n\n\n

Accessing Netdata Web Interface<\/h3>\n\n\n\n

You can now access your NetData Web interface via the address http:<hostname-or-IP>:19999<\/code>. This should land you on the beautiful various system metrics NetData dashboard.<\/p>\n\n\n\n

\"Install<\/figure>\n\n\n\n

You can explore other system metrics;<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Network stats;<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

You can further explore the tool by checking on the NetData getting started guide link provided below;<\/p>\n\n\n\n

Further Reading<\/h4>\n\n\n\n

Getting Started with NetData<\/a><\/p>\n\n\n\n

Reference<\/h4>\n\n\n\n

NetData Installation Guide<\/a><\/p>\n\n\n\n

Related Tutorials<\/h4>\n\n\n\n

Install and Setup AWStats Log Analyzer on CentOS 8<\/a><\/p>\n\n\n\n

Deploy a Single Node Elastic Stack Cluster on Docker Containers<\/a><\/p>\n\n\n\n

Install and Setup TIG Stack on Ubuntu 20.04<\/a><\/p>\n\n\n\n

Install and Setup Prometheus on Ubuntu 20.04<\/a><\/p>\n\n\n\n

Install Latest Grafana on CentOS 8<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

In this tutorial, you will learn how to install and setup NetData on Ubuntu 20.04\/18.04. NetData is a free and open source, distributed, real-time performance<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,72],"tags":[1913,1910,1909,1911,1912,1623,67,1200],"class_list":["post-6701","post","type-post","status-publish","format-standard","hentry","category-howtos","category-monitoring","tag-install-netdata-in-linux","tag-install-netdata-on-ubuntu-18-04","tag-install-netdata-on-ubuntu-20-04","tag-monitor-system-metrics-with-netdata","tag-netdata","tag-system-monitoring","tag-ubuntu-18-04","tag-ubuntu-20-04","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/6701"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=6701"}],"version-history":[{"count":5,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/6701\/revisions"}],"predecessor-version":[{"id":21482,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/6701\/revisions\/21482"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=6701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=6701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=6701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}