#server-performance

Prometheus and node_exporter setup guide

15 min read - May 29, 2026

hero section cover
Table of contents
  • Prometheus and node_exporter server monitoring setup
  • Installing node_exporter
  • Running node_exporter as a systemd service
  • Configuring Prometheus to scrape node_exporter
  • Securing your monitoring stack
  • Monitoring best practices and next steps
  • Troubleshooting
Share

Install Prometheus and node_exporter, configure scrape targets, set up systemd services and secure your monitoring stack. Step-by-step for Linux.

Prometheus and node_exporter server monitoring setup

Prometheus scrapes and stores time-series metrics. node_exporter exposes system-level data like CPU, memory and disk usage for Prometheus to collect. This guide covers installing both, configuring scrape targets, running node_exporter as a systemd service and locking down access.

Installing node_exporter

Download the latest stable release from the official GitHub releases page. As of May 2026, that's version 1.11.1. Replace amd64 with arm64 if needed.

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

Verify the SHA256 checksum against the value on the releases page, then extract and install:

tar -xzvf node_exporter-1.11.1.linux-amd64.tar.gz
sudo mv node_exporter-1.11.1.linux-amd64/node_exporter /usr/local/bin/

Create a dedicated system user with no home directory and no login shell:

sudo useradd --no-create-home --shell /bin/false node_exporter
sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter

Test it by running /usr/local/bin/node_exporter directly, then check the output:

curl http://localhost:9100/metrics

You should see lines prefixed with node_, including metrics like node_cpu_seconds_total and node_memory_MemAvailable_bytes. By default, node_exporter exposes around 500 time series.

Running node_exporter as a systemd service

Running node_exporter from the terminal is fine for testing, but it stops when you close the session. Create a unit file at /etc/systemd/system/node_exporter.service:

[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target
 
[Service]
User=node_exporter
Group=node_exporter
Type=simple
Restart=on-failure
RestartSec=5
ExecStart=/usr/local/bin/node_exporter
 
[Install]
WantedBy=multi-user.target

Enable and start the service:

sudo systemctl daemon-reload
sudo systemctl enable node_exporter
sudo systemctl start node_exporter

Confirm it's running with sudo systemctl status node_exporter. The output should show active (running).

If Prometheus runs on the same host, bind node_exporter to localhost only by changing the ExecStart line:

ExecStart=/usr/local/bin/node_exporter --web.listen-address="127.0.0.1:9100"

Configuring Prometheus to scrape node_exporter

Open /etc/prometheus/prometheus.yml and add a job under scrape_configs:

scrape_configs:
  - job_name: 'node_exporter'
    scrape_interval: 15s
    static_configs:
      - targets: ['localhost:9100']
        labels:
          env: 'production'

The job_name identifies the source in queries and dashboards. targets points to the host and port where node_exporter listens. Labels like env help you filter metrics later.

Validate the config before restarting:

promtool check config /etc/prometheus/prometheus.yml

If it passes, reload Prometheus without downtime:

sudo systemctl reload prometheus

Open http://<your-prometheus-ip>:9090, go to Status > Targets and check the node_exporter job shows a green UP status. Run a quick query like node_cpu_seconds_total in the Expression Browser to confirm data is flowing.

Securing your monitoring stack

Never expose ports 9090 or 9100 to the public internet. On Ubuntu/Debian, restrict node_exporter access to your Prometheus server's IP:

sudo ufw allow from <prometheus-ip> to any port 9100

On CentOS/RHEL with firewalld:

firewall-cmd --permanent --add-port=9100/tcp

For the Prometheus web UI, put it behind a reverse proxy like Nginx with basic auth and TLS. A mesh VPN like Tailscale is another option if you need access from multiple locations without exposing ports directly.

Monitoring best practices and next steps

Use node_memory_MemAvailable_bytes instead of MemFree for memory alerts. MemAvailable accounts for buffers and cache, giving a more accurate picture of what's actually free.

Disable collectors you don't need (wifi, nfs, bcache) with the --no-collector.<name> flag to reduce noise.

For disk space alerts, the predict_linear PromQL function lets you forecast when a volume will fill up based on current trends. Setting a 7-day prediction window catches slow leaks before they become outages.

To monitor multiple servers, install node_exporter on each machine and add their IPs to the targets list in prometheus.yml. For larger environments, switch to file-based service discovery instead of hardcoding IPs.

Adding Grafana gives you visual dashboards. The Node Exporter Full dashboard (ID 1860) is a good starting point. Alertmanager routes critical alerts to Slack, email or PagerDuty.

FDC's dedicated servers and VPS plans support Prometheus and node_exporter out of the box. See FDC's dedicated server options.

Troubleshooting

IssueLikely causeCommand to check
Service fails to startWrong binary path or permissionsjournalctl -u node_exporter -xe
Metrics not reachableFirewall blocking port 9100, or wrong bind addressss -lntp | grep 9100
Target Down in PrometheusNetwork issue or wrong target IP in prometheus.ymlcurl -I http://<target-ip>:9100/metrics
Missing specific metricsCollector disabled by defaultnode_exporter --help

Blog

Featured this week

More articles
Digital eye strain: How to protect your vision in a screen-heavy world

Digital eye strain: How to protect your vision in a screen-heavy world

Staring at screens all day? Learn how to reduce digital eye strain with proven techniques and tools. This guide is essential for remote workers, developers, and anyone in tech.

4 min read - May 21, 2025

Why it's important to have a powerful and unmetered VPS

8 min read - May 9, 2025

More articles
background image

Have questions or need a custom solution?

icon

Flexible options

icon

Global reach

icon

Instant deployment

icon

Flexible options

icon

Global reach

icon

Instant deployment