Skip to main content
Running node_exporter directly with ./node_exporter is fine for quick tests, but it has two limitations: it runs in the foreground and it won’t start automatically after a reboot. To let systemd manage node_exporter — so you can use systemctl start node_exporter, systemctl status node_exporter, and have it start on boot — create a system user, place the binary in a standard location, and provide a systemd service unit. Quick local vs systemd commands:
These steps assume you have already downloaded and extracted the node_exporter tarball and are in the extracted directory.
Below are concise, ordered steps to install and configure node_exporter under systemd, with explanations and tips.

1. Move the binary, create a system user, set ownership

Copy the binary to a standard location, create a non-privileged system user, and set ownership so the service runs with least privilege.
Notes:
  • --no-create-home and --shell /sbin/nologin ensure the account is non-interactive.
  • chmod 0755 makes the binary executable for the system user.
  • If you want to run node_exporter on a non-default port or bind to localhost, you can later add flags to the systemd unit’s ExecStart (example shown below).

2. Create the systemd service unit

Create /etc/systemd/system/node_exporter.service with the following content:
Common reasons to adjust the unit:
  • Add startup flags to ExecStart, for example to bind to localhost:
    • ExecStart=/usr/local/bin/node_exporter --web.listen-address=127.0.0.1:9100
  • To provide environment variables, use Environment= or an EnvironmentFile=.
Table — key unit directives and purpose

3. Reload systemd, start and enable the service

Reload the systemd manager configuration, start the service immediately, check its status, and enable it so it starts on boot.
Helpful troubleshooting commands:
  • View logs: sudo journalctl -u node_exporter -f
  • Check whether the unit file syntax is valid: systemd-analyze verify /etc/systemd/system/node_exporter.service
  • If you change the unit, re-run sudo systemctl daemon-reload and sudo systemctl restart node_exporter.
Be careful exposing the metrics endpoint publicly. node_exporter does not authenticate requests. If the host is internet-facing, bind node_exporter to 127.0.0.1:9100 or restrict access via firewall rules.

4. Verify metrics are being served

Use curl or a browser to confirm metrics are available on the expected endpoint:
Example (truncated) output returned by the endpoint:
To have Prometheus scrape this target, add it to your prometheus.yml scrape configuration (for example, using localhost:9100 if Prometheus runs on the same host). See Prometheus scrape configuration docs: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_configs
Example Prometheus scrape config snippet:

Troubleshooting checklist

  • Service won’t start: run sudo journalctl -u node_exporter -b --no-pager and inspect the logs.
  • Port already in use: check ss -ltnp | grep 9100 or adjust --web.listen-address.
  • Permissions issues: verify file ownership ls -l /usr/local/bin/node_exporter and that User=node_exporter exists.
  • Unit changes not applied: run sudo systemctl daemon-reload before restart.
Now node_exporter will be managed by systemd, start automatically on boot when enabled, and expose metrics that Prometheus can scrape.

Watch Video