Skip to content

Install Node Exporter on Ubuntu

Commands

Warning

If you find a mistake or the instructions are outdated, please send me an email.

  • Let's specify the target architecture and version for the node exporter to install. Available architecture options are amd64 or arm64.
export ARCH="amd64" VERSION="1.9.1"
  • Create a Linux service account for the node exporter.
sudo useradd --system --no-create-home --shell /bin/false node_exporter
  • Download Node exporter release from Github.
wget https://github.com/prometheus/node_exporter/releases/download/v${VERSION}/node_exporter-${VERSION}.linux-${ARCH}.tar.gz
  • Unarchive node exporter
tar -xvf node_exporter-${VERSION}.linux-${ARCH}.tar.gz
  • Move Node Exoprter executable to the path.
sudo mv node_exporter-${VERSION}.linux-${ARCH}/node_exporter /usr/local/bin/
  • Clean Up
rm -rf node_exporter*
  • Verify that you successfully installed the Node Exporter.
node_exporter --version
  • Create Node Exporter systemctl service.
sudo tee /etc/systemd/system/node_exporter.service <<EOF
[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target

StartLimitIntervalSec=500
StartLimitBurst=5

[Service]
User=node_exporter
Group=node_exporter
Type=simple
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/bin/node_exporter

[Install]
WantedBy=multi-user.target
EOF
  • Enable the Node Exporter to start automatically on system reboot.
sudo systemctl enable node_exporter
  • Start the Node Exporter service.
sudo systemctl start node_exporter
  • Check the status of the Node Exporter service.
sudo systemctl status node_exporter

Success

If you find it useful, subscribe to my YouTube Channel.