Skip to main content

Command Palette

Search for a command to run...

How to Install Prometheus and Node Exporter on CentOS Stream 9

A complete, SysAdmin-approved guide to installing Prometheus monitoring using official upstream binaries.

Updated
6 min read
How to Install Prometheus and Node Exporter on CentOS Stream 9
M
MIG servers is a premier global provider of Enterprise Dedicated Server Hosting and Colocation Services. We empower businesses to scale worldwide with access to over 15,000 servers across 250+ strategic locations. Our infrastructure is built for performance and stability, utilizing Tier III Data Centers and Tier 1 Bandwidth providers to ensure lowlatency and maximum uptime. Whether you need custom enterprise solutions or rapid global deployment, MIG servers delivers the power and connectivity your business demands.

If you are managing enterprise hardware or dedicated servers, having real-time visibility into your infrastructure is non-negotiable. Prometheus is an industry-standard, open-source monitoring and alerting toolkit. When paired with Node Exporter, it becomes a powerhouse for collecting Linux host metrics like CPU usage, memory consumption, load averages, and network interface statistics.

In this guide, we will show you exactly how to install Prometheus and Node Exporter on CentOS Stream 9. Instead of relying on outdated third-party RPMs, we will use the official upstream binaries. This SysAdmin-approved approach is cleaner, easy to audit, and simple to keep updated.

Prerequisites

Before diving into the installation, ensure you have the following:

  • A CentOS Stream 9 server

  • root or sudo privileges.

  • Firewalld enabled.

  • Server Architecture Knowledge: Know whether you are running x86_64 (Intel/AMD) or aarch64 (Ampere ARM).

✅ Pro Tip: Monitoring many devices creates heavy disk writes. Running this on servers with NVMe storage reduces I/O wait and improves database performance.

Step 1: Update the System and Install Dependencies

First, ensure your system is up to date and that you have the necessary base packages to download, extract, and verify our files.

Bash

dnf -y update
dnf -y install curl tar coreutils

Step 2: Create Dedicated Service Users

For security purposes, services should never run as root. We will create dedicated system users and directories for Prometheus and Node Exporter.

Bash

useradd --system --no-create-home --shell /sbin/nologin prometheus
useradd --system --no-create-home --shell /sbin/nologin node_exporter

install -d -o prometheus -g prometheus -m 0755 /etc/prometheus
install -d -o prometheus -g prometheus -m 0755 /var/lib/prometheus

Step 3: Download and Verify Official Binaries

Next, we will pull the official precompiled binaries. The latest stable versions used in this guide are Prometheus 3.11.1 and Node Exporter 1.11.1.

We will also download the SHA256 checksums to verify the integrity of the downloaded archives.

cd /tmp

case "$(uname -m)" in
  x86_64) ARCH="amd64" ;;
  aarch64|arm64) ARCH="arm64" ;;
  *)
    echo "Unsupported architecture: $(uname -m)"
    exit 1
    ;;
esac

PROM_VERSION="3.11.1"
NODE_EXPORTER_VERSION="1.11.1"

# Download Prometheus and Checksum
curl -LO "https://github.com/prometheus/prometheus/releases/download/v\({PROM_VERSION}/prometheus-\){PROM_VERSION}.linux-${ARCH}.tar.gz"
curl -LO "https://github.com/prometheus/prometheus/releases/download/v${PROM_VERSION}/sha256sums.txt"

# Verify Prometheus Checksum
grep "prometheus-\({PROM_VERSION}.linux-\){ARCH}.tar.gz" sha256sums.txt | sha256sum -c -

# Download Node Exporter and Checksum (Rename sha256sums.txt to avoid overwrite)
curl -LO "https://github.com/prometheus/node_exporter/releases/download/v\({NODE_EXPORTER_VERSION}/node_exporter-\){NODE_EXPORTER_VERSION}.linux-${ARCH}.tar.gz"
curl -L "https://github.com/prometheus/node_exporter/releases/download/v${NODE_EXPORTER_VERSION}/sha256sums.txt" -o sha256sums_node.txt

# Verify Node Exporter Checksum
grep "node_exporter-\({NODE_EXPORTER_VERSION}.linux-\){ARCH}.tar.gz" sha256sums_node.txt | sha256sum -c -

# Extract if checksums pass
tar -xzf "prometheus-\({PROM_VERSION}.linux-\){ARCH}.tar.gz"
tar -xzf "node_exporter-\({NODE_EXPORTER_VERSION}.linux-\){ARCH}.tar.gz"

⚠️ Security Note: Only proceed if the sha256sum commands output OK. This guarantees your binaries are authentic and uncorrupted.

Step 4: Install Binaries and Console Files

Move the extracted binaries to /usr/local/bin and copy the necessary console templates to the Prometheus configuration directory.

install -m 0755 "/tmp/prometheus-\({PROM_VERSION}.linux-\){ARCH}/prometheus" /usr/local/bin/prometheus
install -m 0755 "/tmp/prometheus-\({PROM_VERSION}.linux-\){ARCH}/promtool" /usr/local/bin/promtool
install -m 0755 "/tmp/node_exporter-\({NODE_EXPORTER_VERSION}.linux-\){ARCH}/node_exporter" /usr/local/bin/node_exporter

cp -r "/tmp/prometheus-\({PROM_VERSION}.linux-\){ARCH}/consoles" /etc/prometheus/
cp -r "/tmp/prometheus-\({PROM_VERSION}.linux-\){ARCH}/console_libraries" /etc/prometheus/

chown -R prometheus:prometheus /etc/prometheus /var/lib/prometheus

Step 5: Configure Prometheus

Prometheus needs to know what to monitor. We define these targets in a configuration file using scrape_configs.

cat > /etc/prometheus/prometheus.yml <<'EOF'
global:
  scrape_interval: 15s
  evaluation_interval: 15s

scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['127.0.0.1:9090']

  - job_name: 'node'
    static_configs:
      - targets: ['127.0.0.1:9100']
EOF

chown prometheus:prometheus /etc/prometheus/prometheus.yml
chmod 0644 /etc/prometheus/prometheus.yml

❓ What this does: Prometheus will scrape its own internal metrics on port 9090, and scrape the local Node Exporter metrics on port 9100.

Step 6: Create Systemd Services

To ensure Prometheus and Node Exporter run in the background and start automatically on boot, we create systemd unit files.

Create the Prometheus Service

cat > /etc/systemd/system/prometheus.service <<'EOF'
[Unit]
Description=Prometheus Monitoring Server
Wants=network-online.target
After=network-online.target

[Service]
User=prometheus
Group=prometheus
Type=simple
ExecStart=/usr/local/bin/prometheus \
  --config.file=/etc/prometheus/prometheus.yml \
  --storage.tsdb.path=/var/lib/prometheus \
  --web.console.templates=/etc/prometheus/consoles \
  --web.console.libraries=/etc/prometheus/console_libraries \
  --web.listen-address=0.0.0.0:9090 \
  --storage.tsdb.retention.time=15d
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF

Create the Node Exporter Service

For a local setup, we bind Node Exporter specifically to 127.0.0.1 to prevent unauthorized external access.

cat > /etc/systemd/system/node_exporter.service <<'EOF'
[Unit]
Description=Prometheus Node Exporter
Wants=network-online.target
After=network-online.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
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF

Step 7: Start and Validate Services

Verify your Prometheus configuration syntax before starting:

/usr/local/bin/promtool check config /etc/prometheus/prometheus.yml

If it checks out, reload systemd and start the services:

systemctl daemon-reload
systemctl enable --now prometheus
systemctl enable --now node_exporter

Step 8: Verify Metrics Locally

Let's ensure the services are responding to HTTP requests:

curl -fsS http://127.0.0.1:9090/-/healthy
curl -fsS http://127.0.0.1:9100/metrics | head

Step 9: Configure the Firewall & Security Warning

If you want to access the Prometheus web UI from your browser locally, open port 9090 in Firewalld.

firewall-cmd --permanent --add-port=9090/tcp
firewall-cmd --reload

🚨 CRITICAL SECURITY WARNING: Exposing port 9090 directly to the public internet is highly discouraged. Always secure your setup using a Reverse Proxy (like Nginx/Apache) or a VPN (like WireGuard/Tailscale). Never open port 9100 to the public internet.

Step 10: Access the Web UI and Run PromQL Queries

Navigate to http://YOUR_SERVER_IP:9090/graph in your web browser. Try running these initial PromQL queries:

  • up - Checks if your scrape targets are online.

  • node_load1 - Shows the 1-minute load average.

  • node_memory_MemAvailable_bytes / 1024 / 1024 - Displays available memory in MB.

Common Mistakes to Avoid

  • Skipping configuration validation: Always run promtool check config before restarting.

  • Exposing Node Exporter publicly: Bind it to localhost (127.0.0.1:9100) for single-server setups.

  • Forgetting to reload systemd: Run systemctl daemon-reload whenever you modify unit files.

Conclusion

By installing Prometheus and Node Exporter on CentOS Stream 9 using official binaries, you have built a clean, secure, and highly scalable foundation for dedicated server monitoring. Whether you are tracking simple CPU loads or complex bandwidth usage across an entire fleet of Linux servers, this stack gives you the exact visibility you need.

🚀 Ready to Deploy Your Monitoring Stack?

You have the knowledge, now get the hardware. Run Prometheus and Node Exporter seamlessly on our high-performance Bare Metal Dedicated Servers. Engineered for 24/7 uptime and real-time data processing.

👉 Explore MIG Servers Dedicated Hosting Today