Skip to main content

How to Install and Configure Node Exporter on Ubuntu

In this guide, we will show how to install Node Exporter on Ubuntu and configure it to collect server metrics correctly.

0. Introduction

Node Exporter is an agent that provides data on the status of a Linux server’s CPU, memory, file systems, network interfaces, and other components. The agent runs as a separate process and, by default, exposes metrics via port 9100. Node Exporter is a fairly simple, passive tool: it does not store history, process data, generate alerts, or create graphs. Typically, Node Exporter is used to collect metrics that are subsequently processed by a monitoring system. Such a system - Prometheus, for example - periodically polls the agent and stores the retrieved data for further analysis and visualization.

0.1 Requirements

Before starting, make sure you have:

  • A VPS running Ubuntu 22.04 or 24.04;

  • SSH access to your VPS;

  • Root or sudo privileges;

1. Installing Node Exporter

1.1 Update your system

First, connect to your VPS via SSH.

Update the package list:

sudo apt update

Install the tools required to download and test Node Exporter:

sudo apt install wget curl -y

1.2 Download Node Exporter

Node Exporter can be downloaded directly from its official GitHub repository.

First, navigate to the temporary directory:

cd /tmp

Download Node Exporter:

wget https://github.com/prometheus/node_exporter/releases/download/v1.12.1/node_exporter-1.12.1.linux-amd64.tar.gz

If you want to install a different version, you can find the available releases on the official Node Exporter GitHub page.

1.3 Extract and install Node Exporter

Before extracting the downloaded file, you can verify its SHA256 checksum:

echo "b51d8a76aa2a9156a55d501aca6276fae09e262259a5e4e831d2c2222f084e63  node_exporter-1.12.1.linux-amd64.tar.gz" | sha256sum -c -

You should see:

node_exporter-1.12.1.linux-amd64.tar.gz: OK

If the checksum does not match, do not install the downloaded file.

Now extract the archive:

tar -xzf node_exporter-1.12.1.linux-amd64.tar.gz

Copy the Node Exporter executable to /usr/local/bin/:

sudo install -m 0755 node_exporter-1.12.1.linux-amd64/node_exporter /usr/local/bin/node_exporter

Check the installed version:

node_exporter --version

If the installation was successful, you will see information about the installed Node Exporter version.

2. Configuring Node Exporter

By default, Node Exporter can be started manually. However, it is more convenient to configure it as a systemd service.

This allows Node Exporter to run in the background and start automatically after a server reboot.

2.1 Create a dedicated user

For security reasons, we will create a separate system user for Node Exporter instead of running it as root.

Run:

sudo useradd --system --no-create-home --user-group --shell /usr/sbin/nologin node_exporter

This creates a system account called node_exporter without a login shell.

2.2 Create a systemd service

Create a new service file:

sudo nano /etc/systemd/system/node_exporter.service

Add the following configuration:

[Unit]
Description=Prometheus Node Exporter
After=network.target

[Service]
User=node_exporter
Group=node_exporter
Type=simple
ExecStart=/usr/local/bin/node_exporter --web.listen-address=127.0.0.1:9100
Restart=on-failure

[Install]
WantedBy=multi-user.target

Save the file by pressing Ctrl + O, then Enter, and exit using Ctrl + X.

A few important settings in this configuration:

  • User and Group specify the account used to run Node Exporter.

  • ExecStart defines the location of the executable and its startup options.

  • Restart=on-failure automatically restarts Node Exporter if it crashes.

  • WantedBy=multi-user.target allows the service to start during system boot when enabled.

Note: In this example, Node Exporter listens only on 127.0.0.1:9100. This means its metrics can be accessed from the VPS itself, but not directly from other servers.

3. Managing the Node Exporter service

3.1 Start Node Exporter

After creating the service file, reload systemd:

sudo systemctl daemon-reload

Start Node Exporter:

sudo systemctl start node_exporter

3.2 Enable Node Exporter on boot

To make Node Exporter start automatically when the server reboots, run:

sudo systemctl enable node_exporter

3.3 Check service status

Check whether Node Exporter is running:

sudo systemctl status node_exporter

If everything is configured correctly, you should see:

Active: active (running)

This means Node Exporter is running successfully.

You can also restart or stop the service using these commands:

Restart Node Exporter:

sudo systemctl restart node_exporter

Stop Node Exporter:

sudo systemctl stop node_exporter

4. Checking Node Exporter metrics

Now that Node Exporter is running, we can check whether it is collecting system metrics.

Run the following command on your VPS:

curl http://127.0.0.1:9100/metrics

You should see a long list of metrics containing information about your server.

For example, you may find metrics such as:

Metric

Description

node_cpu_seconds_total

CPU time spent in different operating modes

node_memory_MemTotal_bytes

Total physical memory

node_memory_MemAvailable_bytes

Available memory

node_filesystem_size_bytes

Total filesystem size

node_filesystem_avail_bytes

Available filesystem space

node_network_receive_bytes_total

Total network traffic received

You can also search for a specific metric instead of displaying everything.

For example, to check available memory:

curl -s http://127.0.0.1:9100/metrics | grep '^node_memory_MemAvailable_bytes'

If the command returns a metric and its value, Node Exporter is working correctly.

Please note: Node Exporter only exposes the current metrics. It does not store historical data or provide monitoring dashboards. For these features, you can connect it to Prometheus and Grafana.

If these commands returns an error, please restart the node exporter and then try again:

sudo systemctl restart node_exporter

5. Conclusion

That’s it, Node Exporter is now running on your Ubuntu VPS. It starts automatically on boot and serves system metrics over HTTP, so you can check them right on the server. If you want to track CPU, RAM, disk usage and so on over time, add it as a target in Prometheus.

For more details, see the official Node Exporter guide.

Did this answer your question?