Monitoring and Observing My First Linux Server: A Beginner’s Guide to Prometheus & Grafana.

Published: (February 3, 2026 at 04:18 AM EST)
3 min read
Source: Dev.to

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

ConceptWhat it tells you
MonitoringIs the system working? (e.g., “Is CPU > 80%?”)
ObservabilityWhy 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

  1. Instrumentation (Sensors) – Tools that emit signals from infrastructure/apps.
  2. Collection (Pipeline) – Collectors clean, label, and route the data.
  3. Storage (Library) – Metrics, logs, and traces live in optimized databases.
  4. 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

RoleTool
Target (VM)Node Exporter – “spy/sensor” that gathers hardware stats
Control Center (Laptop)Prometheus – “brain & storage” (time‑series DB)
FaceGrafana – turns raw numbers into beautiful dashboards

🚀 Step‑by‑Step Implementation

Step 1 – Set Up the Target (VirtualBox VM)

  1. 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.
  2. Start the VM and get its IP address:

    hostname -I

    Assume the IP is 192.168.1.50.

  3. Install the “spy” (Node Exporter)

    sudo apt update
    sudo apt install prometheus-node-exporter -y
  4. Verify
    Open a browser on your laptop and navigate to http://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)

  1. Install Prometheus

    sudo apt update
    sudo apt install prometheus -y
  2. Configure Prometheus to scrape the VM

    sudo nano /etc/prometheus/prometheus.yml

    Add the following job at the end of the scrape_configs list:

    - job_name: 'ubuntu_vm'
      static_configs:
        - targets: ['192.168.1.50:9100']

    Save & exit (Ctrl+O, Enter, Ctrl+X).

  3. Restart Prometheus

    sudo systemctl restart prometheus

    Prometheus UI screenshot

Step 3 – Visualise with Grafana

  1. 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
  2. Access Grafana
    Open http://localhost:3000 in a browser.
    Default credentials: admin / admin (you’ll be prompted to change the password).

  3. Add Prometheus as a data source

    • Connections → Data Sources → Add Data Source
    • Choose Prometheus
    • URL: http://localhost:9090
    • Click Save & Test

    Grafana data source configuration

  4. 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

    Grafana dashboard import screen

💡 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.
Back to Blog

Related posts

Read more »