Prometheus collects and stores metrics from your servers. Grafana turns those metrics into dashboards and alerts. Run Node Exporter on each Linux server, point Prometheus at it on port 9100, then add Prometheus to Grafana as a data source and build a dashboard.
Updated 2026-11-19. Versions checked that day: Prometheus 3.16.0 (LTS 3.13.5) and Node Exporter 1.13.0.
What Are Prometheus and Grafana?
Prometheus is an open-source monitoring and alerting toolkit that collects metrics from servers and applications and stores them as time series data. Grafana is an open-source visualisation tool that reads that data and draws it as graphs, gauges and tables on a dashboard. Prometheus gathers and stores the numbers. Grafana makes them easy to read.
What Is Prometheus?
Prometheus is an open-source systems monitoring and alerting toolkit, originally built at SoundCloud and started in 2012, according to the Prometheus overview. It joined the Cloud Native Computing Foundation in 2016, and all its components are available under the Apache 2 License.
It works on a pull model. Prometheus requests metrics over HTTP from each target, stores every sample locally with a timestamp, and lets you query the data with PromQL, its query language. It isn’t the right tool when you need 100% accuracy, such as per-request billing. For server health, it fits well.
What Is Grafana?
Grafana OSS is the free, self-managed open source edition of Grafana. It lets you query, visualise, alert on and explore metrics, logs and traces wherever they’re stored, according to the Grafana documentation.
Grafana doesn’t store metric data itself. It connects to outside systems called data sources, such as Prometheus, MySQL or PostgreSQL, Elasticsearch and Amazon CloudWatch. That’s why a Prometheus and Grafana pair works so well: one stores, the other shows.
Go deeper
Practice on real network labs.
The CCNA Lab Workbook has 75 hands-on labs in EVE-NG and Packet Tracer, including SNMP, DHCP, DNS and NTP on a multi-VLAN topology.
See the CCNA Lab Workbook →Prometheus vs Grafana: What Is the Difference?
Prometheus collects, stores and queries metrics. Grafana displays data from Prometheus and other sources. They aren’t rivals. Most monitoring setups run both, and Grafana can’t draw a Prometheus graph until Prometheus has something stored.

| Prometheus | Grafana | |
|---|---|---|
| Main job | Collect, store and query metrics | Show data on dashboards and send alerts |
| How data arrives | Pulls from each target’s /metrics page | Queries a data source |
| Stores metrics | Yes, in its own time series database | No |
| Query language | PromQL | The language of the data source |
| Alerts | Alerting rules, sent to Alertmanager | Grafana’s own alerting |
| Default port | 9090 | 3000 |
Can Grafana work without Prometheus? Yes. Grafana reads from many data sources, and Prometheus is only one of them. Can Prometheus work without Grafana? Yes. It has its own web page for queries and graphs, but Grafana makes dashboards far easier to build and share.
How Prometheus Collects Data From Your Servers
Prometheus collects data by scraping. On a schedule, it requests a /metrics page over HTTP from each target and stores what it finds. An exporter is a small program that exposes a system’s numbers on that page. The sample configuration in the Prometheus getting-started guide scrapes every 15 seconds.
The flow has four steps:
- Prometheus asks an exporter for data, such as the current CPU use.
- The exporter answers with numbers, such as CPU 30% and memory 40%.
- Prometheus stores each number with the time it was collected. That’s time series data.
- You read the data on Prometheus’s own web page or through Grafana.
What Is Node Exporter and What Does It Expose?
Node Exporter is the Prometheus exporter for hardware and OS metrics on *NIX kernels such as Linux. It’s built from modular collectors, listens on HTTP port 9100 by default, and shows its metrics at /metrics, according to the Node Exporter project. The cpu and meminfo collectors are on by default.
You install it on every server you want to watch. It covers CPU use, memory, disk space, network traffic and uptime. On Windows, the project recommends the separate Windows exporter instead.
Three metric names you’ll meet first, from the Prometheus Node Exporter guide:
node_cpu_seconds_totalfor CPU timenode_filesystem_avail_bytesfor disk space available to non-root usersnode_network_receive_bytes_totalfor network traffic received
Prometheus, Node Exporter and Grafana Default Ports
Prometheus listens on port 9090, Node Exporter on port 9100 and Grafana on port 3000 by default. All three speak HTTP, so you can check each one in a browser or with curl.
| Service | Default port | What you see | Who connects |
|---|---|---|---|
| Grafana | 3000 | Login page, then dashboards | You, in a browser |
| Prometheus | 9090 | Status page and query box | You, and Grafana |
| Node Exporter | 9100 | A /metrics page of plain text | Prometheus |
In this guide, Prometheus and Node Exporter share one server. Prometheus scrapes localhost:9100, so port 9100 doesn’t need an inbound rule on the instance at all.

How to Install Prometheus and Node Exporter on an EC2 Instance
Download each tarball from GitHub, extract it, start Node Exporter, then start Prometheus with the --config.file flag. That takes a handful of commands and no package manager. Prometheus’s download page lists Prometheus 3.16.0, released 2026-11-04, and Node Exporter 1.13.0, released 2026-11-19.

The commands below assume an x86_64 Linux instance such as Amazon Linux 2023. On a Graviton (arm64) instance, download the linux-arm64 file instead of linux-amd64.
Launch the Instance and Set the Security Group
Launch a Linux EC2 instance and connect over SSH. In the security group, allow port 22 from your own IP. Add port 3000 for Grafana and port 9090 for Prometheus, and set the source to My IP, not Anywhere. A source of 0.0.0.0/0 opens the port to the whole internet, and AWS shows a warning for it in the console. Port 9100 stays closed because Prometheus reaches it on localhost.
Install and Start Node Exporter
wget https://github.com/prometheus/node_exporter/releases/download/v1.13.0/node_exporter-1.13.0.linux-amd64.tar.gz
tar xvfz node_exporter-1.13.0.linux-amd64.tar.gz
cd node_exporter-1.13.0.linux-amd64
./node_exporter
Open a second SSH session and check that it answers:
curl http://localhost:9100/metrics | grep "node_"
A long list of lines starting with node_ means Node Exporter works.
Install Prometheus
wget https://github.com/prometheus/prometheus/releases/download/v3.16.0/prometheus-3.16.0.linux-amd64.tar.gz
tar xvf prometheus-3.16.0.linux-amd64.tar.gz
cd prometheus-3.16.0.linux-amd64
Don’t start it yet. Edit the config file first, in the next section.
These commands run in the foreground, so they stop when you close the terminal. The free PDF shows the package route with systemctl start and systemctl status, which keeps the services running after you log out.
How to Configure Prometheus to Scrape Node Exporter
You tell Prometheus where to look in the scrape_configs section of prometheus.yml. Add one job named node with the target localhost:9100, then start Prometheus. The job_name labels the exporter, and targets is the address and port where it runs.
Replace the contents of prometheus.yml with the layout from the Prometheus Node Exporter guide. YAML cares about spaces, so copy the indentation exactly:
global:
scrape_interval: 15s
scrape_configs:
- job_name: node
static_configs:
- targets: ['localhost:9100']
Start Prometheus from its folder:
./prometheus --config.file=./prometheus.yml
The job name matters later. The community dashboard in the dashboard section expects the default job name node, so use that name here.
Confirm the Target Is UP on the Targets Page
Open http://<your-server-public-ip>:9090/targets, or choose Status, then Target health, in the Prometheus menu. Under the node job you should see state UP. That means Prometheus is scraping Node Exporter.
Then click the Graph tab, type node_cpu_seconds_total, and click Execute. You’ll see live data.
What Is Alertmanager and Do You Need It?
Alertmanager is the Prometheus component that handles alerts. Prometheus evaluates alerting rules and sends firing alerts to Alertmanager, which manages them, including silencing, inhibition and aggregation, and sends notifications by email, on-call tools or chat, according to the Prometheus alerting overview.
You don’t need it to draw dashboards. You need it when you want to be told about a problem instead of finding it yourself. This guide stops before Alertmanager setup, because that deserves its own walk-through. Grafana also has its own alerting, which reads from the same data source.
How to Install Grafana on the Same Server
Add Grafana’s RPM repository, install the grafana package with dnf, then start the grafana-server service. Grafana listens on port 3000 by default. The repository address is https://rpm.grafana.com, as given in the Grafana install guide for RHEL and Fedora.
sudo tee /etc/yum.repos.d/grafana.repo <<'EOF'
[grafana]
name=grafana
baseurl=https://rpm.grafana.com
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://rpm.grafana.com/gpg.key
sslverify=1
EOF
sudo dnf install grafana
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl enable grafana-server.service
Each option sits on its own line. A repo file with two options on one line fails.
Open http://<your-server-public-ip>:3000 in a browser. You should see the Grafana sign-in page.
Grafana Default Username and Password
Grafana’s default login is admin for both the username and the password. After you sign in, Grafana prompts you to change the password. The Grafana sign-in guide says it strongly recommends changing it, so do that on first login.
How to Add Prometheus as a Grafana Data Source
In Grafana, open Connections, click Add new connection, search for Prometheus, click Add new data source, enter the Prometheus server URL http://localhost:9090, and click Save & test. Grafana then shows “Successfully queried the Prometheus API.” That’s the message in the Grafana Prometheus data source guide.

If Prometheus runs on a different server, use http://<Prometheus-IP>:9090 instead of localhost. Leave the other settings at their defaults. Menu names have moved between Grafana versions. The steps here follow the current Grafana documentation, and the PDF’s screenshots show Grafana 10.4.
How to Build Your First Grafana Dashboard for Server Monitoring
Create a new dashboard, add a visualisation, choose the Prometheus data source, type a PromQL query and run it. A graph with live data appears. Start with CPU and memory, the two panels the free PDF builds. Then pick a visualisation type such as time series, gauge, table or pie chart, set the unit, and save the dashboard with a name.
PromQL for CPU and Memory Usage
CPU time in Node Exporter is a counter. Prometheus defines a counter as a cumulative metric that can only increase or be reset to zero on restart. If you graph node_cpu_seconds_total raw, you get a line that only climbs. Wrap it in rate(), which the Prometheus docs describe as the per-second average rate of increase of a series over a range, and use it only on counters.
| Panel | Query | What it shows |
|---|---|---|
| CPU busy (%) | 100 - (avg(rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) | Share of CPU time not idle, averaged over 5 minutes |
| CPU in system mode | rate(node_cpu_seconds_total{mode="system"}[1m]) | Seconds of system-mode CPU per second |
| Memory available (%) | node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes * 100 | Share of RAM still available |
| Network in | rate(node_network_receive_bytes_total[1m]) | Bytes received per second |
| Disk free | node_filesystem_avail_bytes | Bytes available to non-root users |
Memory is a gauge, so you query it directly. A gauge is a value that can go up and down. Set the unit to Percent (0-100) for the percentage panels and bytes for the others. Without a unit, Grafana shows a bare number such as 597680128, which is hard to read.
Import a Ready-Made Node Exporter Dashboard
Node Exporter Full is a community dashboard on grafana.com with ID 1860. It only requires the default job name node, which is why the configuration step above uses it. In Grafana, open Dashboards, choose New, then Import, enter 1860, and pick your Prometheus data source. You get dozens of CPU, memory, disk and network panels without writing a query.
Self-Hosted on EC2 or Amazon Managed Prometheus and Grafana?
Self-hosting on EC2 means you install, patch and scale Prometheus and Grafana yourself. Amazon Managed Service for Prometheus and Amazon Managed Grafana are AWS-run services that remove that work and bill by usage. For one or two servers and a learning setup, the self-hosted route in this guide is the simpler start.
| Option | Who runs it | Facts from the vendor docs |
|---|---|---|
| Self-hosted on EC2 | You | You choose versions, storage and backups |
| Amazon Managed Service for Prometheus | AWS | Serverless and Prometheus-compatible. Uses PromQL. Keeps data 150 days by default, up to 1095 days. Replicates data across three Availability Zones. Billed for ingestion and storage of metrics |
| Amazon Managed Grafana | AWS | AWS manages provisioning, setup, scaling and maintenance. Priced per active user in a workspace. Works with Amazon Managed Service for Prometheus as a data source |
| Grafana Cloud | Grafana Labs | Managed platform with a free tier of up to three users and 10k metrics |
AWS describes its Prometheus service as built for container metrics, and it works with Amazon EKS and self-managed Kubernetes clusters. Sources: Amazon Managed Service for Prometheus, Amazon Managed Grafana and the Grafana OSS page.
Prometheus and Grafana Security Checklist
A monitoring server exposes details about your machines, so lock it down before you leave it running. Four checks cover most of the risk:
- Limit the ports. Allow 3000 and 9090 only from your own IP, or from a VPN or reverse proxy you control.
- Keep 9100 closed. Node Exporter exposes a wide variety of hardware and kernel metrics. When Prometheus runs on the same server, it reaches Node Exporter on localhost.
- Change the Grafana password. Replace the default
adminpassword on first login. - Check the rules after changes. Every new service you add tempts you to open one more port. Review the security group each time.
What to Learn Next
You now have a working stack: Node Exporter, Prometheus and Grafana. These are the next steps, in a sensible order:
- Alertmanager. Turn a threshold into an email or a chat message.
- PromQL. Learn
rate(),avgand label filters, then build your own panels. - Containers. Run the same stack in Docker with the Docker Compose commands cheat sheet, and see the Docker commands cheat sheet for the basics.
- Kubernetes. The kubectl commands cheat sheet covers the troubleshooting side.
- Network gear. Prometheus scrapes exporters, while SNMP polls devices on a schedule. Read how SNMP polling works, then see the CCNA Workbook for the SNMP topic alongside DHCP, DNS and NTP in a multi-VLAN lab.
- Code for network devices. The CCNA Automation Workbook has 60+ Python, REST API, YANG, NETCONF and Ansible labs, for when you want to configure and check devices with scripts.
- Interview prep. The DevOps interview questions PDF has 180 questions across the toolchain.
No questions yet. Ask the first one.