Monitoring and Observing My First Linux Server: A Beginner’s Guide to Prometheus & Grafana.
Source: Dev.to
Ever wondered what’s really happening inside a Linux server?
As a DevOps engineer (or someone learning the ropes), you’ll soon move beyond “just running commands” to actually observing your infrastructure. This guide walks you through building a simple observability stack with Prometheus and Grafana—the “Linux Health Sentinel”.
🔍 Monitoring vs. Observability
| Concept | What it tells you |
|---|---|
| Monitoring | Is the system working? (e.g., “Is CPU > 80%?”) |
| Observability | Why is it behaving that way? – looks at the data (“signals”) the system emits. |
Observability is a system, not just a tool:
sensors → data pipeline → dashboard
The 4 Phases of Observability
- Instrumentation (Sensors) – Tools that emit signals from infrastructure/apps.
- Collection (Pipeline) – Collectors clean, label, and route the data.
- Storage (Library) – Metrics, logs, and traces live in optimized databases.
- Visualization & Alerting – Dashboards + alerts turn data into action.
🎯 Project Goal
Visualise the real‑time CPU, memory, and disk health of an Ubuntu VM using the industry‑standard Prometheus + Grafana stack.
🛠️ Tech Stack
| Role | Tool |
|---|---|
| Target (VM) | Node Exporter – “spy/sensor” that gathers hardware stats |
| Control Center (Laptop) | Prometheus – “brain & storage” (time‑series DB) |
| Face | Grafana – turns raw numbers into beautiful dashboards |
🚀 Step‑by‑Step Implementation
Step 1 – Set Up the Target (VirtualBox VM)
-
Network Setup (crucial)
- In VirtualBox: Settings → Network
- Change Attached to from NAT to Bridged Adapter.
- Why? Gives the VM an IP on your home network so the laptop can reach it.
-
Start the VM and get its IP address:
hostname -IAssume the IP is
192.168.1.50. -
Install the “spy” (Node Exporter)
sudo apt update sudo apt install prometheus-node-exporter -y -
Verify
Open a browser on your laptop and navigate tohttp://192.168.1.50:9100/metrics.
You should see a wall of text – the exporter is running.
Step 2 – Set Up the Control Center (Your Laptop)
-
Install Prometheus
sudo apt update sudo apt install prometheus -y -
Configure Prometheus to scrape the VM
sudo nano /etc/prometheus/prometheus.ymlAdd the following job at the end of the
scrape_configslist:- job_name: 'ubuntu_vm' static_configs: - targets: ['192.168.1.50:9100']Save & exit (
Ctrl+O,Enter,Ctrl+X). -
Restart Prometheus
sudo systemctl restart prometheus
Step 3 – Visualise with Grafana
-
Install Grafana
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/grafana.gpg > /dev/null sudo apt update && sudo apt install grafana -y sudo systemctl enable --now grafana-server -
Access Grafana
Openhttp://localhost:3000in a browser.
Default credentials: admin / admin (you’ll be prompted to change the password). -
Add Prometheus as a data source
- Connections → Data Sources → Add Data Source
- Choose Prometheus
- URL:
http://localhost:9090 - Click Save & Test

-
Import the Node Exporter dashboard
- Click the + (top‑right) → Import
- Dashboard ID: 1860 (official Node Exporter dashboard)
- Select the Prometheus data source you just added and click Import

💡 The Result
With just a single Ubuntu VM, Prometheus, and Grafana you now have a real observability pipeline:
- CPU, memory, and disk metrics are collected by Node Exporter.
- Prometheus scrapes and stores those metrics.
- Grafana visualises them in real time, ready for alerting or deeper analysis.
You’ve moved from “running commands” to seeing what’s happening under the hood—exactly what production monitoring looks like! 🎉
# Observability Foundations
Works in professional environments.
This small project is the foundation of modern DevOps observability. From here, you can explore:
- **Alerting with Alertmanager**
- **Container monitoring**
- **Kubernetes observability**
- **Logs and distributed tracing**
Observability isn’t just about dashboards; it’s about understanding your systems deeply.