bolt Valebyte VPS from $4/mo — NVMe, 60s deploy.

Get a VPS arrow_forward
eco Beginner Tutorial/How-to

Prometheus & Grafana: Bare Metal Server Monitoring Setup Guide

calendar_month Sep 06, 2026 schedule 7 min read visibility 17 views
Prometheus & Grafana: Bare Metal Server Monitoring Setup Guide
info

Need a server for this guide? We offer dedicated servers and VPS in 50+ countries with instant setup.

Setting up Prometheus and Grafana for bare metal server monitoring requires a minimum of 2 vCPU, 4GB RAM, and 40GB SSD storage on your monitoring server for a basic setup. This guide provides a practical, step-by-step tutorial to deploy these powerful open-source tools to gain deep insights into your server's performance and health. By following these instructions, you will establish a comprehensive monitoring solution for your critical infrastructure.

Need a server for this guide?

Deploy a VPS or dedicated server in minutes.

Why Prometheus and Grafana for Bare Metal Monitoring?

Bare metal servers offer unparalleled performance, control, and isolation, making them ideal for demanding workloads like high-traffic web hosting, large databases, game servers, CI/CD pipelines, and streaming services. However, managing these powerful machines effectively requires robust monitoring. Prometheus excels at collecting time-series data, while Grafana provides intuitive dashboards for visualizing that data. Together, they form a potent combination for understanding server health, identifying bottlenecks, and proactively addressing issues.

This tutorial focuses on installing the monitoring stack (Prometheus and Grafana) on a dedicated server or a robust VPS, which will then monitor other bare metal servers using Node Exporter. This ensures the monitoring system itself has dedicated resources and doesn't contend with the services running on the monitored machines.

Prerequisites and Minimum Server Requirements

Before you begin, ensure you have:

  • A dedicated server or a robust VPS from Valebyte with a fresh installation of Ubuntu 22.04 LTS (or a similar Debian-based distribution). For the monitoring server itself, we recommend at least 4 vCPU, 8GB RAM, and 100GB NVMe storage for production use, allowing for data retention and dashboard responsiveness.
  • Root or sudo access to the monitoring server.
  • Root or sudo access to the bare metal servers you wish to monitor.
  • Basic understanding of Linux command-line interface.
  • Open ports in your firewall: 9090 for Prometheus, 3000 for Grafana, and 9100 for Node Exporter (on monitored servers).

Step-by-Step Installation Guide

Step 1: Update System and Install Dependencies

First, connect to your monitoring server via SSH and update your package lists and installed packages. Install necessary utilities:

sudo apt update
sudo apt upgrade -y
sudo apt install -y wget curl gnupg2 software-properties-common apt-transport-https

Step 2: Install Prometheus Server

Prometheus does not typically reside in standard Ubuntu repositories, so we will download the latest stable release directly.

  1. Create Prometheus user and directories:
  2. sudo useradd --no-create-home --shell /bin/false prometheus
    sudo mkdir /etc/prometheus
    sudo mkdir /var/lib/prometheus
    sudo chown prometheus:prometheus /var/lib/prometheus
  3. Download and extract Prometheus: Replace 2.47.1 with the latest stable version if different. Check Prometheus Downloads.
  4. wget https://github.com/prometheus/prometheus/releases/download/v2.47.1/prometheus-2.47.1.linux-amd64.tar.gz
    tar xvfz prometheus-2.47.1.linux-amd64.tar.gz
    sudo cp prometheus-2.47.1.linux-amd64/prometheus /usr/local/bin/
    sudo cp prometheus-2.47.1.linux-amd64/promtool /usr/local/bin/
    sudo cp -r prometheus-2.47.1.linux-amd64/consoles /etc/prometheus
    sudo cp -r prometheus-2.47.1.linux-amd64/console_libraries /etc/prometheus
    sudo chown prometheus:prometheus /usr/local/bin/prometheus
    sudo chown prometheus:prometheus /usr/local/bin/promtool
    sudo chown -R prometheus:prometheus /etc/prometheus/consoles
    sudo chown -R prometheus:prometheus /etc/prometheus/console_libraries
    rm -rf prometheus-2.47.1.linux-amd64.tar.gz prometheus-2.47.1.linux-amd64
  5. Create Prometheus configuration file (/etc/prometheus/prometheus.yml):
  6. sudo nano /etc/prometheus/prometheus.yml

    Paste the following content. This configuration includes a basic scrape target for Prometheus itself and a placeholder for Node Exporter targets.

    global:
      scrape_interval: 15s # How frequently to scrape targets
      evaluation_interval: 15s # How frequently to evaluate rules
    
    scrape_configs:
      - job_name: 'prometheus'
        static_configs:
          - targets: ['localhost:9090']
    
      # Add your bare metal servers here after installing Node Exporter
      # - job_name: 'node_exporter'
      #   static_configs:
      #     - targets: ['your_server_ip_1:9100', 'your_server_ip_2:9100']

    Save and exit (Ctrl+X, Y, Enter).

  7. Set ownership for configuration:
  8. sudo chown prometheus:prometheus /etc/prometheus/prometheus.yml
  9. Create a systemd service file for Prometheus (/etc/systemd/system/prometheus.service):
  10. sudo nano /etc/systemd/system/prometheus.service

    Paste the following:

    [Unit]
    Description=Prometheus Monitoring System
    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.enable-lifecycle
    
    [Install]
    WantedBy=multi-user.target

    Save and exit.

  11. Reload systemd, start, and enable Prometheus:
  12. sudo systemctl daemon-reload
    sudo systemctl start prometheus
    sudo systemctl enable prometheus
  13. Verify Prometheus status:
  14. sudo systemctl status prometheus

    You should see active (running). Access Prometheus UI in your browser at http://YOUR_MONITORING_SERVER_IP:9090.

Step 3: Install Node Exporter on Monitored Bare Metal Servers

Node Exporter is an agent that collects system metrics (CPU, RAM, disk I/O, network) and exposes them for Prometheus to scrape. Install this on each bare metal server you want to monitor.

  1. Create Node Exporter user and directories:
  2. sudo useradd --no-create-home --shell /bin/false node_exporter
  3. Download and extract Node Exporter: Replace 1.6.1 with the latest stable version if different. Check Node Exporter Downloads.
  4. wget https://github.com/prometheus/node_exporter/releases/download/v1.6.1/node_exporter-1.6.1.linux-amd64.tar.gz
    tar xvfz node_exporter-1.6.1.linux-amd64.tar.gz
    sudo cp node_exporter-1.6.1.linux-amd64/node_exporter /usr/local/bin/
    sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter
    rm -rf node_exporter-1.6.1.linux-amd64.tar.gz node_exporter-1.6.1.linux-amd64
  5. Create a systemd service file for Node Exporter (/etc/systemd/system/node_exporter.service):
  6. sudo nano /etc/systemd/system/node_exporter.service

    Paste the following:

    [Unit]
    Description=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
    
    [Install]
    WantedBy=multi-user.target

    Save and exit.

  7. Reload systemd, start, and enable Node Exporter:
  8. sudo systemctl daemon-reload
    sudo systemctl start node_exporter
    sudo systemctl enable node_exporter
  9. Verify Node Exporter status:
  10. sudo systemctl status node_exporter

    You should see active (running). Access Node Exporter metrics in your browser at http://YOUR_MONITORED_SERVER_IP:9100/metrics.

Step 4: Configure Prometheus to Scrape Node Exporter Targets

Now, go back to your monitoring server. Edit the Prometheus configuration to add your bare metal servers.

  1. Edit Prometheus configuration:
  2. sudo nano /etc/prometheus/prometheus.yml
  3. Add new job_name entries for your bare metal servers: Replace your_server_ip_1, your_server_ip_2 with the actual IP addresses of your monitored servers.
  4. # ... existing configuration ...
    
    scrape_configs:
      - job_name: 'prometheus'
        static_configs:
          - targets: ['localhost:9090']
    
      - job_name: 'node_exporter'
        static_configs:
          - targets: ['192.168.1.10:9100', '192.168.1.11:9100', 'your_next_server_ip:9100']
        # Optionally, add labels for better organization
        # labels:
        #   environment: production
        #   location: datacenter_a

    Save and exit.

  5. Check Prometheus configuration for syntax errors:
  6. /usr/local/bin/promtool check config /etc/prometheus/prometheus.yml

    It should output SUCCESS!. If not, fix any reported errors.

  7. Reload Prometheus to apply changes:
  8. sudo systemctl reload prometheus
  9. Verify targets in Prometheus UI: Navigate to http://YOUR_MONITORING_SERVER_IP:9090/targets. You should see your Node Exporter targets listed with a 'UP' state.

Step 5: Install Grafana

Grafana provides the visualization layer for your Prometheus data.

  1. Add Grafana GPG key:
  2. sudo wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key
  3. Add Grafana repository:
  4. echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
  5. Update apt cache and install Grafana:
  6. sudo apt update
    sudo apt install -y grafana
  7. Start and enable Grafana service:
  8. sudo systemctl daemon-reload
    sudo systemctl start grafana-server
    sudo systemctl enable grafana-server
  9. Verify Grafana status:
  10. sudo systemctl status grafana-server

    You should see active (running). Access Grafana UI in your browser at http://YOUR_MONITORING_SERVER_IP:3000. The default login is admin / admin. You will be prompted to change the password on first login.

Step 6: Configure Grafana Data Source and Dashboard

Now, connect Grafana to Prometheus and import a useful dashboard.

  1. Add Prometheus as a Data Source:
    • Log in to Grafana (admin/admin).
    • Click the gear icon (Configuration) on the left sidebar, then 'Data sources'.
    • Click 'Add data source'.
    • Select 'Prometheus'.
    • For 'Name', enter Prometheus.
    • For 'URL', enter http://localhost:9090.
    • Scroll down and click 'Save & test'. You should see 'Data source is working'.
  2. Import a Node Exporter Dashboard:
    • Click the '+' icon (Create) on the left sidebar, then 'Import'.
    • In the 'Import via grafana.com' field, enter 1860 (a popular Node Exporter Full dashboard ID).
    • Click 'Load'.
    • On the next screen, select your 'Prometheus' data source from the dropdown.
    • Click 'Import'.

    You should now see a comprehensive dashboard visualizing metrics from all your monitored bare metal servers.

Use Cases for Bare Metal Monitoring

With Prometheus and Grafana, you can monitor a wide array of bare metal workloads:

  • Web Hosting: Track Nginx/Apache requests per second, response times, concurrent connections, and resource usage to ensure optimal website performance.
  • Databases (e.g., PostgreSQL, MySQL): Monitor query latency, active connections, buffer hit ratios, disk I/O, and replication status to maintain database health.
  • Game Servers: Keep an eye on CPU utilization, network latency, player counts, and memory usage to provide a smooth gaming experience.
  • Streaming Services: Observe bandwidth usage, concurrent streams, and server load to ensure uninterrupted content delivery.
  • CI/CD Pipelines: Monitor build agent resources, disk space, and network activity during continuous integration and deployment processes.
  • Self-Hosted Applications: Track resource consumption of custom applications, mail servers (e.g., Postfix, Dovecot), or VPN services (e.g., OpenVPN, WireGuard) to ensure their stability.
Quick pick
Need a dedicated server?
Bare metal with NVMe in 70+ locations — configure and order in minutes.
Browse servers

Troubleshooting Common Issues

  • Prometheus/Grafana/Node Exporter not starting: Check sudo systemctl status <service_name> and sudo journalctl -xeu <service_name> for error messages.
  • Prometheus not scraping targets: Verify target IP addresses and port numbers in prometheus.yml. Ensure firewalls (e.g., UFW) on both the monitoring and monitored servers allow traffic on ports 9090 (Prometheus), 3000 (Grafana), and 9100 (Node Exporter). Check http://YOUR_MONITORING_SERVER_IP:9090/targets in Prometheus UI for scrape errors.
  • Grafana not displaying data: Confirm the Prometheus data source is configured correctly and 'Save & test' shows success. Ensure the dashboard you imported is compatible with Node Exporter metrics.
  • Permissions issues: Double-check file and directory ownership (chown) and permissions (chmod) for Prometheus and Node Exporter binaries and configuration files.

The right server infrastructure is crucial for efficient monitoring. Below are general hardware recommendations for your monitoring server based on the scale of your bare metal environment.

Number of Monitored Servers (with Node Exporter) vCPU / Cores RAM Disk (Type + GB) Monthly Bandwidth
Up to 10 servers 4 vCPU 8 GB 100 GB NVMe 1 TB
10 - 50 servers 8 cores 16-32 GB 250 GB NVMe 2 TB
50 - 150 servers 12-16 cores 32-64 GB 500 GB NVMe (or larger HDD for long-term storage) 5 TB
150+ servers (with high metric cardinality) 16-24 cores 64-128 GB 1 TB+ NVMe (or clustered storage solution) 10 TB+

table_chart Valebyte Server Options for Hosting the Monitoring Stack

Option vCPU / Cores RAM Storage Best for
Valebyte VPS (e.g., 4C/8GB) 4 vCPU 8 GB 100 GB NVMe Small to medium bare metal environments (up to 50 servers) or development setups.
Valebyte Dedicated Server (e.g., 8C/32GB) 8 Cores 32 GB 500 GB NVMe Large bare metal environments (50+ servers), high-cardinality metrics, or critical production monitoring.

check_circle Conclusion

By following this tutorial, you have successfully deployed a robust Prometheus and Grafana monitoring stack on your dedicated server, capable of collecting and visualizing critical metrics from your bare metal infrastructure. This setup provides the foundation for proactive maintenance, performance optimization, and ensuring the high availability of your services. For reliable dedicated servers or high-performance VPS options to host your monitoring stack or your critical bare metal workloads, explore Valebyte's offerings.

help Frequently Asked Questions

Was this guide helpful?

Your feedback helps us improve our guides.

Share this post:

Send this guide to someone who may find it useful.

Telegram VKVK WhatsApp Facebook LinkedIn XX

Prometheus Grafana bare metal monitoring server monitoring setup Prometheus Node Exporter Grafana dashboards dedicated server monitoring self-hosting monitoring Ubuntu server monitoring Prometheus tutorial Grafana installation guide server infrastructure monitoring
support_agent
Valebyte Support
Usually replies within minutes
Hi there!
Send us a message and we'll reply as soon as possible.