Candid photograph of a Linux server terminal with a soft olive-green glow against a dark slate background, conveying a calm technical atmosphere.

Step-by-step guides for system administrators — covering command-line basics, web server setup, and preparation material for technical interviews.

Browse Tutorials

Install Prometheus and Node Exporter on RHEL

Monitoring a RHEL host becomes more predictable when host statistics and time-series collection run as separate, managed services. This guide explains how to install and configure Prometheus and Node Exporter on RHEL 8 or RHEL 9 using systemd, firewalld, and durable files under /etc and /var/lib. Node Exporter exposes machine metrics, while Prometheus scrapes those metrics and stores them for dashboards and alerts.

The examples assume a 64-bit machine, a sudo-capable administrator, and access to the official GitHub release pages. Review upstream release notes and select compatible versions before installation. Prometheus timestamps remain in UTC even when Sydney or Melbourne teams read graphs in AEST or AEDT, so schedule labels should use values such as Australia/Sydney only when local time genuinely affects the workload.

Prepare the RHEL host

Start with the required archive and download tools, then check whether SELinux and firewalld are active. Keep SELinux enforcing during setup rather than disabling it to work around a permission problem.

sudo dnf install -y curl tar gzip
getenforce
sudo systemctl is-active firewalld

Prometheus and Node Exporter publish architecture-specific archives. Set the architecture and example release pins in the same shell used for the remaining commands; replace the example versions with currently supported releases.

ARCH=$(uname -m)
case "$ARCH" in
  x86_64) PROM_ARCH=amd64; NODE_ARCH=x86_64 ;;
  aarch64) PROM_ARCH=arm64; NODE_ARCH=arm64 ;;
  *) echo "Unsupported architecture"; exit 1 ;;
esac
PROM_VERSION=3.5.0
NODE_VERSION=1.9.1

RHEL images can differ in enabled repositories, firewall rules, and SSH access policy. Record the intended management subnet before opening any metric port, particularly on systems connected through an Australian hosting provider or cloud account.

Install Node Exporter

Download the Node Exporter archive into a temporary directory and calculate its digest. Compare that value with the checksum published beside the release before extracting anything.

cd /tmp
curl -fLO "https://github.com/prometheus/node_exporter/releases/download/v${NODE_VERSION}/node_exporter-${NODE_VERSION}.linux-${NODE_ARCH}.tar.gz"
sha256sum node_exporter-*.tar.gz

After the checksum matches, create a dedicated unprivileged account and install the executable with root ownership. The exporter needs no home directory or write access because it reports host counters rather than storing its own dataset.

tar -xzf node_exporter-${NODE_VERSION}.linux-${NODE_ARCH}.tar.gz
sudo useradd --system --no-create-home --shell /sbin/nologin node_exporter
sudo install -o root -g root -m 0755 \
  node_exporter-${NODE_VERSION}.linux-${NODE_ARCH}/node_exporter \
  /usr/local/bin/node_exporter

Create a systemd unit that binds the exporter to loopback by default, then enable and test it. A loopback listener suits this single-host setup; a remote Prometheus server needs a private interface instead.

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

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

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now node_exporter
curl -fsS http://127.0.0.1:9100/metrics | grep '^node_cpu_seconds_total'

Install the Prometheus server

Fetch the Prometheus archive and checksum it in the same way. The release contains prometheus, promtool, and supporting assets, but only those two binaries need to be placed in the system path for this configuration.

cd /tmp
curl -fLO "https://github.com/prometheus/prometheus/releases/download/v${PROM_VERSION}/prometheus-${PROM_VERSION}.linux-${PROM_ARCH}.tar.gz"
sha256sum prometheus-*.tar.gz

Once the digest is verified, extract the release, create a service identity, and give that identity ownership of the time-series directory. Store the configuration under /etc/prometheus, separate from application data.

tar -xzf prometheus-${PROM_VERSION}.linux-${PROM_ARCH}.tar.gz
sudo useradd --system --home-dir /var/lib/prometheus --shell /sbin/nologin prometheus
sudo install -d -o prometheus -g prometheus -m 0750 /var/lib/prometheus
sudo install -d -o root -g root -m 0755 /etc/prometheus
sudo install -o root -g root -m 0755 \
  prometheus-${PROM_VERSION}.linux-${PROM_ARCH}/prometheus \
  /usr/local/bin/prometheus
sudo install -o root -g root -m 0755 \
  prometheus-${PROM_VERSION}.linux-${PROM_ARCH}/promtool \
  /usr/local/bin/promtool

Add a hardened unit with the web interface bound to localhost. The ReadWritePaths exception limits storage writes while the other directives keep most of the filesystem read-only. Administrators revising service-management concepts can also use Linuxtpoint's Linux interview questions.

[Unit]
Description=Prometheus Monitoring Server
After=network-online.target
Wants=network-online.target

[Service]
User=prometheus
Group=prometheus
ExecStart=/usr/local/bin/prometheus \
  --config.file=/etc/prometheus/prometheus.yml \
  --storage.tsdb.path=/var/lib/prometheus \
  --web.listen-address=127.0.0.1:9090
Restart=on-failure
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/lib/prometheus

[Install]
WantedBy=multi-user.target

Configure scraping and startup

Prometheus discovers targets through prometheus.yml. This minimal configuration scrapes the local Node Exporter every 15 seconds, providing timely host visibility without creating excessive short-lived series.

sudo tee /etc/prometheus/prometheus.yml >/dev/null <<'EOF'
global:
  scrape_interval: 15s
scrape_configs:
  - job_name: node-local
    static_configs:
      - targets: ['127.0.0.1:9100']
        labels:
          environment: production
EOF
sudo /usr/local/bin/promtool check config /etc/prometheus/prometheus.yml
sudo systemctl daemon-reload
sudo systemctl enable --now prometheus

Add remote exporters as static targets only after their addresses are reachable through the private network. Avoid placing customer names, email addresses, or ticket references in labels. If metrics are linked to personal information, Australian organisations must apply the Privacy Act 1988 and, where applicable, the Notifiable Data Breaches scheme to access and retention.

Secure local and remote access

Both services remain accessible through SSH port forwarding while their listeners stay on 127.0.0.1. This is the simplest option for an administrator working from Sydney or Melbourne and avoids creating an unauthenticated public metrics endpoint.

ssh -L 9090:127.0.0.1:9090 administrator@rhel-host

For a dedicated monitoring network, bind Prometheus to its private IPv4 address and permit only the management subnet. Permit port 9100 in the same restricted manner only when a remote Prometheus instance must scrape this exporter.

sudo firewall-cmd --permanent \
  --add-rich-rule='rule family="ipv4" source address="10.20.0.0/16" port port="9090" protocol="tcp" accept'
sudo firewall-cmd --reload

Cloud controls still apply. For EC2 instances in AWS's Sydney ap-southeast-2 or Melbourne ap-southeast-4 region, use security groups as a second boundary and avoid allowing 0.0.0.0/0 to ports 9090 or 9100. Align firewall changes with the Australian Signals Directorate's Essential Eight, and investigate SELinux audit denials rather than switching it off.

Verify and maintain the stack

Check that both units remain active and that each HTTP endpoint returns expected data. The Prometheus health endpoint should confirm that the server is healthy, while the target API reports whether Node Exporter is reachable.

systemctl is-active prometheus node_exporter
curl -fsS http://127.0.0.1:9100/metrics | grep '^node_cpu_seconds_total'
curl -fsS http://127.0.0.1:9090/-/healthy
curl -fsS http://127.0.0.1:9090/api/v1/targets

Open http://127.0.0.1:9090 through the SSH tunnel to inspect the Targets and Graph pages. If a public status page depends on the same application stack, browser-level checks such as Thucydides web tests can complement exporter, API, and target checks rather than replace them.

Monitor disk usage under /var/lib/prometheus, service restart counts, and scrape failures before the data fills the volume. The next concrete step is to save the active-service result, target-health output, and verified versions in the RHEL host inventory.