| 1 | # Install Netdata on Linux from a Git checkout |
| 2 | |
| 3 | To install the latest git version of Netdata, please follow these 2 steps: |
| 4 | |
| 5 | 1. [Prepare your system](#prepare-your-system) |
| 6 | |
| 7 | Install the required packages on your system. |
| 8 | |
| 9 | 2. [Install Netdata](#install-netdata) |
| 10 | |
| 11 | Download and install Netdata. You can also update it the same way. |
| 12 | |
| 13 | ## Prepare your system |
| 14 | |
| 15 | Before you begin, make sure that your repo and the repo's submodules are clean from any previous builds and up to date. |
| 16 | Otherwise, [perform a cleanup](/packaging/installer/methods/manual.md#perform-a-cleanup-in-your-netdata-repo) |
| 17 | |
| 18 | Use our automatic requirements installer (_no need to be `root`_), which attempts to find the packages that |
| 19 | should be installed on your system to build and run Netdata. It supports a large variety of major Linux distributions |
| 20 | and other operating systems and is regularly tested. You can find this tool [here](https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/install-required-packages.sh) or run it directly with `bash <(curl -sSL https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/install-required-packages.sh)`. Otherwise read on for how to get requires packages manually: |
| 21 | |
| 22 | - **Alpine** Linux and its derivatives |
| 23 | - You have to install `bash` yourself, before using the installer. |
| 24 | |
| 25 | - **Gentoo** Linux and its derivatives |
| 26 | |
| 27 | - **Debian** Linux and its derivatives (including **Ubuntu**, **Mint**) |
| 28 | |
| 29 | - **Red Hat Enterprise Linux** and its derivatives (including **Fedora**, **CentOS**, **Amazon Machine Image**) |
| 30 | - Please note that for RHEL/CentOS you need |
| 31 | [EPEL](http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/). |
| 32 | In addition, RHEL/CentOS version 6 also need |
| 33 | [OKay](https://okay.com.mx) for package libuv version 1. |
| 34 | - CentOS 8 / RHEL 8 requires a bit of extra work. See the dedicated section below. |
| 35 | |
| 36 | - **SUSE** Linux and its derivatives (including **openSUSE**) |
| 37 | |
| 38 | - **SLE12** Must have your system registered with SUSE Customer Center or have the DVD. See |
| 39 | [#1162](https://github.com/netdata/netdata/issues/1162) |
| 40 | |
| 41 | Install the packages for having a **basic Netdata installation** (system monitoring and many applications, without `mysql` / `mariadb`, `named`, hardware sensors and `SNMP`): |
| 42 | |
| 43 | ```sh |
| 44 | curl -Ss 'https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/install-required-packages.sh' >/tmp/install-required-packages.sh && bash /tmp/install-required-packages.sh -i netdata |
| 45 | ``` |
| 46 | |
| 47 | Install all the required packages for **monitoring everything Netdata can monitor**: |
| 48 | |
| 49 | ```sh |
| 50 | curl -Ss 'https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/install-required-packages.sh' >/tmp/install-required-packages.sh && bash /tmp/install-required-packages.sh -i netdata-all |
| 51 | ``` |
| 52 | |
| 53 | If the above do not work for you, please [open a github |
| 54 | issue](https://github.com/netdata/netdata/issues/new?title=packages%20installer%20failed&labels=installation%20help&body=The%20experimental%20packages%20installer%20failed.%0A%0AThis%20is%20what%20it%20says:%0A%0A%60%60%60txt%0A%0Aplease%20paste%20your%20screen%20here%0A%0A%60%60%60) |
| 55 | with a copy of the message you get on screen. We are trying to make it work everywhere (this is also why the script |
| 56 | [reports back](https://github.com/netdata/netdata/issues/2054) success or failure for all its runs). |
| 57 | |
| 58 | --- |
| 59 | |
| 60 | This is how to do it by hand: |
| 61 | |
| 62 | ```sh |
| 63 | # Debian / Ubuntu |
| 64 | apt-get install zlib1g-dev uuid-dev libuv1-dev liblz4-dev libssl-dev libelf-dev libmnl-dev libprotobuf-dev protobuf-compiler gcc g++ make git autoconf autoconf-archive autogen automake pkg-config curl python cmake |
| 65 | |
| 66 | # Fedora |
| 67 | dnf install zlib-devel libuuid-devel libuv-devel lz4-devel openssl-devel elfutils-libelf-devel libmnl-devel protobuf-devel protobuf-compiler gcc gcc-c++ make git autoconf autoconf-archive autogen automake pkgconfig curl findutils python cmake |
| 68 | |
| 69 | # CentOS / Red Hat Enterprise Linux |
| 70 | yum install autoconf automake curl gcc gcc-c++ git libmnl-devel libuuid-devel openssl-devel libuv-devel lz4-devel elfutils-libelf-devel protobuf protobuf-devel protobuf-compiler make nc pkgconfig python zlib-devel cmake |
| 71 | |
| 72 | # openSUSE |
| 73 | zypper install zlib-devel libuuid-devel libuv-devel liblz4-devel libopenssl-devel libelf-devel libmnl-devel protobuf-devel gcc gcc-c++ make git autoconf autoconf-archive autogen automake pkgconfig curl findutils python cmake |
| 74 | ``` |
| 75 | |
| 76 | Once Netdata is compiled, to run it the following packages are required (already installed using the above commands): |
| 77 | |
| 78 | | package | description | |
| 79 | |:---------:|---------------------------------------------------------------------------------------| |
| 80 | | `libuuid` | part of `util-linux` for GUIDs management | |
| 81 | | `zlib` | gzip compression for the internal Netdata web server | |
| 82 | | `libuv` | Multi-platform support library with a focus on asynchronous I/O, version 1 or greater | |
| 83 | |
| 84 | _Netdata will fail to start without the above._ |
| 85 | |
| 86 | Netdata plugins and various aspects of Netdata can be enabled or benefit when these are installed (they are optional): |
| 87 | |
| 88 | | package | description | |
| 89 | |:--------------------------------------------:|----------------------------------------------------------------------------------------------------------------| |
| 90 | | `bash` | for shell plugins and **alert notifications** | |
| 91 | | `curl` | for shell plugins and **alert notifications** | |
| 92 | | `iproute` or `iproute2` | for monitoring **Linux traffic QoS**<br/>use `iproute2` if `iproute` reports as not available or obsolete | |
| 93 | | `python` | for most of the external plugins | |
| 94 | | `python-yaml` | used for monitoring **beanstalkd** | |
| 95 | | `python-beanstalkc` | used for monitoring **beanstalkd** | |
| 96 | | `python-mysqldb`<br/>or<br/>`python-pymysql` | used for monitoring **mysql** or **mariadb** databases<br/>`python-mysqldb` is a lot faster and thus preferred | |
| 97 | | `nodejs` | used for `node.js` plugins for monitoring **named** and **SNMP** devices | |
| 98 | | `lm-sensors` | for monitoring **hardware sensors** | |
| 99 | | `libelf` | for monitoring kernel-level metrics using eBPF | |
| 100 | | `libmnl` | for collecting netfilter metrics | |
| 101 | | `netcat` | for shell plugins to collect metrics from remote systems | |
| 102 | |
| 103 | _Netdata will greatly benefit if you have the above packages installed, but it will still work without them._ |
| 104 | |
| 105 | Netdata DB engine can be enabled when these are installed (they are optional): |
| 106 | |
| 107 | | package | description | |
| 108 | |:---------:|---------------------------------------------------------------| |
| 109 | | `liblz4` | Extremely fast compression algorithm, version r129 or greater | |
| 110 | | `openssl` | Cryptography and SSL/TLS toolkit | |
| 111 | |
| 112 | _Netdata will greatly benefit if you have the above packages installed, but it will still work without them._ |
| 113 | |
| 114 | Netdata Cloud support may require the following packages to be installed: |
| 115 | |
| 116 | | package | description | |
| 117 | |:----------:|--------------------------------------------------------------------------------------------------------------------------------------| |
| 118 | | `cmake` | Needed at build time if you aren't using your distribution's version of libwebsockets or are building on a platform other than Linux | |
| 119 | | `openssl` | Needed to secure communications with the Netdata Cloud | |
| 120 | | `protobuf` | Used for the new Cloud<->Agent binary protocol | |
| 121 | |
| 122 | _Netdata will greatly benefit if you have the above packages installed, but it will still work without them._ |
| 123 | |
| 124 | ### CentOS / RHEL 6.x |
| 125 | |
| 126 | On CentOS / RHEL 6.x, many of the dependencies for Netdata are only |
| 127 | available with versions older than what we need, so special setup is |
| 128 | required if manually installing packages. |
| 129 | |
| 130 | CentOS 6.x: |
| 131 | |
| 132 | - Enable the EPEL repo |
| 133 | - Enable the additional repo from [okay.network](https://okay.network) |
| 134 | |
| 135 | And install the minimum required dependencies. |
| 136 | |
| 137 | ### CentOS / RHEL 8.x |
| 138 | |
| 139 | For CentOS / RHEL 8.x a lot of development packages have moved out into their |
| 140 | own separate repositories. Some other dependencies are either missing completely |
| 141 | or have to be sourced by 3rd-parties. |
| 142 | |
| 143 | CentOS 8.x: |
| 144 | |
| 145 | - Enable the PowerTools repo |
| 146 | - Enable the EPEL repo |
| 147 | - Enable the Extra repo from [OKAY](https://okay.network) |
| 148 | |
| 149 | And install the minimum required dependencies: |
| 150 | |
| 151 | ```sh |
| 152 | # Enable config-manager |
| 153 | yum install -y 'dnf-command(config-manager)' |
| 154 | |
| 155 | # Enable PowerTools |
| 156 | yum config-manager --set-enabled powertools |
| 157 | |
| 158 | # Enable EPEL |
| 159 | yum install -y epel-release |
| 160 | |
| 161 | # Install Repo for libuv-devl (NEW) |
| 162 | yum install -y http://repo.okay.com.mx/centos/8/x86_64/release/okay-release-1-3.el8.noarch.rpm |
| 163 | |
| 164 | # Install Devel Packages |
| 165 | yum install autoconf automake curl gcc git cmake libuuid-devel openssl-devel libuv-devel lz4-devel make nc pkgconfig python3 zlib-devel |
| 166 | |
| 167 | ``` |
| 168 | |
| 169 | ## Install Netdata |
| 170 | |
| 171 | Do this to install and run Netdata: |
| 172 | |
| 173 | ```sh |
| 174 | # download it - the directory 'netdata' will be created |
| 175 | git clone https://github.com/netdata/netdata.git --depth=100 --recursive |
| 176 | cd netdata |
| 177 | |
| 178 | # run script with root privileges to build, install, start Netdata |
| 179 | ./netdata-installer.sh |
| 180 | ``` |
| 181 | |
| 182 | - If you don't want to run it straight-away, add `--dont-start-it` option. |
| 183 | |
| 184 | - You can also append `--stable-channel` to fetch and install only the official releases from GitHub, instead of the nightly builds. |
| 185 | |
| 186 | - If you don't want to install it on the default directories, you can run the installer like this: `./netdata-installer.sh --install-prefix /opt`. This one will install Netdata in `/opt/netdata`. |
| 187 | |
| 188 | - If your server does not have access to the internet and you have manually put the installation directory on your server, you will need to pass the option `--disable-go` to the installer. The option will prevent the installer from attempting to download and install `go.d.plugin`. |
| 189 | |
| 190 | ## Optional parameters to alter your installation |
| 191 | |
| 192 | `netdata-installer.sh` accepts a few parameters to customize your installation: |
| 193 | |
| 194 | - `--dont-wait`: Enable automated installs by not prompting for permission to install any required packages. |
| 195 | - `--dont-start-it`: Prevent the installer from starting Netdata automatically. |
| 196 | - `--stable-channel`: Automatically update only on the release of new major versions. |
| 197 | - `--nightly-channel`: Automatically update on every new nightly build. |
| 198 | - `--disable-telemetry`: Opt-out of [anonymous statistics](/docs/netdata-agent/configuration/anonymous-telemetry-events.md) we use to make |
| 199 | Netdata better. |
| 200 | - `--no-updates`: Prevent automatic updates of any kind. |
| 201 | - `--reinstall`: If an existing install is detected, reinstall instead of trying to update it. Note that this |
| 202 | cannot be used to change installation types. |
| 203 | - `--local-files`: Used for [offline installations](/packaging/installer/methods/offline.md). Pass four file paths: the Netdata |
| 204 | tarball, the checksum file, the go.d plugin tarball, and the go.d plugin config tarball, to force kickstart run the |
| 205 | process using those files. This option conflicts with the `--stable-channel` option. If you set this _and_ |
| 206 | `--stable-channel`, Netdata will use the local files. |
| 207 | |
| 208 | ### Connect node to Netdata Cloud during installation |
| 209 | |
| 210 | Unlike the [`kickstart.sh`](/packaging/installer/methods/kickstart.md), the `netdata-installer.sh` script does |
| 211 | not allow you to automatically [connect](/src/claim/README.md) your node to Netdata Cloud immediately after installation. |
| 212 | |
| 213 | See the [connect to Netdata Cloud](/src/claim/README.md) doc for details on connecting a node with a manual installation of Netdata. |
| 214 | |
| 215 | ### 'nonrepresentable section on output' errors |
| 216 | |
| 217 | Our current build process unfortunately has some issues when using certain configurations of the `clang` C compiler on Linux. |
| 218 | |
| 219 | If the installation fails with errors like `/bin/ld: externaldeps/libwebsockets/libwebsockets.a(context.c.o): relocation R_X86_64_32 against '.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC`, and you are trying to build with `clang` on Linux, you will need to build Netdata using GCC to get a fully functional install. |
| 220 | |
| 221 | In most cases, you can do this by running `CC=gcc ./netdata-installer.sh`. |
| 222 | |
| 223 | ### Perform a cleanup in your netdata repo |
| 224 | |
| 225 | The Netdata repo consist of the main git tree and it's submodules. Either working on a fork or on the main repo you need to make sure that there |
| 226 | are no "leftover" artifacts from previous builds and that your submodules are up to date to the **corresponding checkouts**. |
| 227 | |
| 228 | > #### Important: Make sure that you have committed any work in progress, before you proceed the with the clean up instruction below |
| 229 | |
| 230 | ```sh |
| 231 | git clean -dfx && git submodule foreach 'git clean -dfx' && git submodule update --recursive --init |
| 232 | ``` |
| 233 | |
| 234 | > Note: In previous builds, you may have created artifacts belonging to an another user (e.g root), so you may need to run each of the _git clean_ commands as a sudoer. |