Grafana is the industry-standard visualization and analytics platform for infrastructure telemetry. It turns complex time-series metrics into clean, interactive dashboards that display real-time CPU saturation, memory pressure, disk I/O latency, and network throughput.
Technical Architecture Note: Grafana does not collect metrics from Linux servers by itself. It is a visualization frontend that queries time-series databases such as Prometheus, InfluxDB, or VictoriaMetrics. To monitor Linux servers, you deploy Node Exporter on the target hosts, aggregate metrics in Prometheus, and visualize them in Grafana.
At a Glance
- Understand the monitoring pipeline: Node Exporter (collector) → Prometheus (storage) → Grafana (visualization).
- Install Grafana using official APT or RPM package repositories.
- Start and enable the
grafana-serversystemd service. - Allow TCP port 3000 in your server firewall (or configure an Nginx SSL reverse proxy).
- Access the Grafana web UI at
http://your-server-ip:3000and change the defaultadmincredentials. - Add Prometheus as a Data Source in Grafana.
- Import the production-grade Node Exporter Full dashboard (ID
1860). - Verify live CPU, RAM, disk, and network metrics across your Linux fleet.
The Complete Monitoring Architecture
To monitor Linux infrastructure with Grafana, three layers work in unison:
Monitored Linux Server Central Monitoring Host
+-------------------------+ +--------------------------+
| Linux Kernel Metrics | | Prometheus Server |
| | | TCP 9100 | (Time-Series Database) |
| +--------v------------+ | (Scrape Pull) | |
| | Node Exporter | +-------------> | Reads metrics every 15s |
| | (Port 9100) | | +------------+-------------+
+-------------------------+ |
| PromQL Queries
| (TCP 9090)
v
+--------------------------+
| Grafana Web Dashboard |
| (Port 3000 / HTTPS) |
+--------------------------+
- Node Exporter (Port 9100): Runs on target Linux servers, exposing kernel
/procand/syshardware counters over HTTP. - Prometheus (Port 9090): Polls (scrapes) Node Exporter endpoints and stores timestamped metric points.
- Grafana (Port 3000): Queries Prometheus using PromQL to render graphs, gauges, and historical heatmaps.
Prerequisites
Before starting the installation, ensure you have:
- A Linux server running Ubuntu (22.04/24.04), Debian (11/12), or AlmaLinux/Rocky Linux (8/9).
- Root or
sudoadministrative privileges. - A working Prometheus server scraping your monitored Linux nodes (or installable on the same host).
- Inbound TCP port 3000 open in your firewall.
Step 1: Install Grafana from Official Repositories
Avoid installing outdated Grafana packages from base OS repositories. Always configure the official Grafana Labs repository.
For Ubuntu / Debian:
# Install prerequisite packages
apt update && apt install -y apt-transport-https software-properties-common wget gpg
# Add Grafana GPG signing key
mkdir -p /etc/apt/keyrings/
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | tee /etc/apt/keyrings/grafana.gpg > /dev/null
# Add Grafana stable repository
echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | tee /etc/apt/sources.list.d/grafana.list
# Update package index and install Grafana Enterprise (Free Community Edition)
apt update && apt install -y grafana
For AlmaLinux / Rocky Linux / RHEL 8 or 9:
# Create YUM repository configuration file
cat << 'EOF' | tee /etc/yum.repos.d/grafana.repo
[grafana]
name=grafana
baseurl=https://rpm.grafana.com
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://rpm.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
EOF
# Install Grafana
dnf install -y grafana
Step 2: Start and Enable the Grafana Daemon
Start the Grafana server service and enable it to launch automatically upon server reboot:
# Reload systemd daemon
systemctl daemon-reload
# Start and enable grafana-server
systemctl enable --now grafana-server
# Verify service status
systemctl status grafana-server
Expected output:
Active: active (running) since Sun 2026-09-06 14:20:00 UTC; 5s ago
Step 3: Configure Firewall Access
Allow inbound traffic on Grafana’s default TCP port 3000:
# On AlmaLinux / Rocky Linux / RHEL (firewalld):
firewall-cmd --permanent --add-port=3000/tcp
firewall-cmd --reload
# On Ubuntu / Debian (UFW):
ufw allow 3000/tcp
ufw reload
Production Recommendation: In enterprise environments, avoid exposing port 3000 directly to the public internet. Instead, configure an Nginx reverse proxy with a Let’s Encrypt SSL certificate terminating HTTPS on port 443.
Step 4: Access Grafana Web UI and Change Default Password
- Open your web browser and navigate to:
http://YOUR_SERVER_IP:3000 - Log in with the default credentials:
- Email / Username:
admin - Password:
admin
- Email / Username:
- The interface will prompt you to set a strong new password. Complete this immediately to secure your installation.
Step 5: Add Prometheus as a Data Source in Grafana
- In the left navigation sidebar, navigate to Connections >> Data sources (or click the gear icon Settings >> Data Sources).
- Click Add data source.
- Select Prometheus from the list of available sources.
- Under the Connection settings:
- Prometheus server URL: Enter
http://localhost:9090(orhttp://PROMETHEUS_SERVER_IP:9090). - Scrape interval: Set to
15s(matching yourprometheus.yml).
- Prometheus server URL: Enter
- Scroll to the bottom and click Save & test.
- Look for the green confirmation badge:
Successfully queried the Prometheus API.
Step 6: Import the Production Linux Dashboard (ID 1860)
Rather than building complex CPU and disk panels from scratch, import the community-standard Node Exporter Full dashboard:
- In the top right of the dashboard navigation, click the + icon and select Import dashboard (or go to Dashboards >> Import).
- In the Import via grafana.com input box, enter dashboard ID:
1860 - Click Load.
- In the options dialog:
- Set Name:
Linux Server Fleet Monitoring. - Under Prometheus, select your Prometheus data source from the dropdown.
- Set Name:
- Click Import.
The dashboard immediately renders complete real-time performance statistics across all nodes scraped by your Prometheus server.
Step 7: Key Infrastructure Metrics to Monitor
Verify that the following essential performance metrics are rendering correctly:
- CPU Utilization & Load Average: Shows user, system, iowait, and idle core percentages (
1m,5m,15mload averages). - RAM & Swap Saturation: Tracks active memory, cache/buffers, and swap paging rate.
- Disk IOPS & Latency: Monitors read/write IOPS and storage response latency (
node_disk_io_time_seconds_total). - Filesystem Available Space: Displays remaining disk capacity and projected exhaustion timelines.
- Network Interface Throughput: Tracks inbound/outbound bandwidth and packet error counters (
node_network_receive_errs_total).
Step 8: Configure Alerting Rules and Notifications
Grafana includes a native Alerting engine (Grafana Alerting):
- Navigate to Alerts & Incident >> Alert rules.
- Click Create alert rule.
- Define the evaluation query using PromQL:
# Alert if CPU usage exceeds 90% for 5 minutes 100 - (avg by (instance) (rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) > 90 - Set evaluation interval to
1mfor5m. - Under Contact points, configure your notification channel (Email, Slack, Discord, Telegram, or PagerDuty webhook).
- Click Save rule and exit.
Troubleshooting
Problem: “HTTP Error 502: Bad Gateway when testing Prometheus Data Source”
Possible cause: Prometheus is not running, or Grafana cannot reach Prometheus on port 9090.
Check:
systemctl status prometheus
curl -I http://localhost:9090/metrics
Solution: Start the Prometheus daemon and verify the URL specified in Grafana Data Source settings:
systemctl restart prometheus
Problem: “Dashboard shows ‘N/A’ or ‘No Data’ for all panels”
Possible cause: The Node Exporter job name in Prometheus does not match the dashboard variable, or Node Exporter is unreachable.
Check: Query Prometheus directly in Explore:
node_cpu_seconds_total
Solution: Check prometheus.yml to verify that your scrape config targets your Linux node:
scrape_configs:
- job_name: 'node'
static_configs:
- targets: ['localhost:9100']
Problem: “Grafana port 3000 connection timed out from browser”
Possible cause: Firewall is blocking port 3000, or Grafana is binding exclusively to 127.0.0.1.
Check:
ss -tulpn | grep :3000
Solution: Ensure Grafana binds to 0.0.0.0 or :: in /etc/grafana/grafana.ini and verify firewall ports.
Verify the Configuration
To verify that Grafana is operating smoothly:
- Verify Live Data Streaming: Open your imported Linux dashboard and change the time range to Last 5 minutes with a 5s auto-refresh. Verify graphs update dynamically.
- Verify Alert Test: In Contact Points, click Test on your notification channel to verify an alert ping reaches your email or webhook.
- Verify Historical Retention: Change the time range to Last 7 days to verify Prometheus historical retention and Grafana query performance.
Production Checklist
- Installed Grafana via official Grafana Labs repository.
- Started and enabled
grafana-serversystemd unit. - Changed default
admin:adminpassword to a secure secret. - Permitted port 3000 in firewall (or configured Nginx SSL reverse proxy).
- Added and verified Prometheus data source connection.
- Imported Node Exporter Full dashboard (ID 1860).
- Verified live CPU, RAM, Disk IOPS, and network graphs.
- Configured alert thresholds for disk space and CPU starvation.
Frequently Asked Questions
Can Grafana monitor servers without Prometheus?
Yes. Grafana can query other data sources like Zabbix (via the official Zabbix plugin for Grafana), InfluxDB, CloudWatch, Datadog, or Elasticsearch.
What is the difference between Zabbix and Grafana?
Zabbix is an all-in-one monitoring system that includes its own agent, polling engine, database, and alerting pipeline. Grafana is a dedicated visualization platform that connects to separate metric backends like Prometheus or Zabbix.
How many servers can a single Grafana instance monitor?
Grafana itself does not store metric data, so a single lightweight Grafana instance (2 vCPUs, 2GB RAM) can easily visualize thousands of servers backed by scaled Prometheus or VictoriaMetrics clusters.
Related Guides & Services
- How to Install and Configure Zabbix to Monitor Linux Servers
- How to Troubleshoot High Load on Production Linux Servers
- Infrastructure Monitoring & Alert Triage Services
- DevOps & Infrastructure Automation
Need Custom Dashboards or 24/7 Monitoring Management?
Building clean dashboards and maintaining Prometheus clusters takes time. If you need senior DevOps engineers to design customized monitoring pipelines and handle alert escalations 24/7, contact our team.