← Back to list

Monitoring a Home Server with Prometheus, Grafana, and Node Exporter

A step-by-step guide to deploying Prometheus and Grafana with Docker Compose, exposing Linux host metrics through Node Exporter, and…

Md. Mahim Hossain · 2026-06-11 07:11 · 5 claps · 6.0 min read
#grafana #prometheus #node-exporter #soc #homelab
Open on Medium ↗
Wiki topics: ☁️ · DevOps & Cloud 🔒 · Cybersecurity 🔓 · Open Source

Monitoring a Home Server with Prometheus, Grafana, and Node Exporter

A step-by-step guide to deploying Prometheus and Grafana with Docker Compose, exposing Linux host metrics through Node Exporter, and importing a ready-made Grafana dashboard.

Architecture Overview

Before diving into the configuration, it is helpful to understand how these pieces fit together:

  • Node Exporter runs natively on the Linux host and exposes system metrics on port 9100.
  • Prometheus, running in a Docker container, scrapes metrics from Node Exporter as well as internal metrics from itself.
  • Grafana, also running via Docker, connects to Prometheus as a data source and visualizes the collected metrics.
  • A community dashboard (Node Exporter Full, ID 1860) is imported into Grafana to provide immediate, out-of-the-box monitoring views.

Prerequisites

To follow along with this guide, ensure you have the following ready:

  • A Linux server or Virtual Machine (VM).
  • Docker and Docker Compose installed on the host.
  • sudo access for installing Node Exporter as a system-level systemd service.
  • Open ports on your host firewall: 3000 (Grafana), 9090 (Prometheus), and 9100 (Node Exporter).
  • The internal or static IP address of your server available.

Step 1 — Deploy Prometheus with Docker Compose

We will start by deploying Prometheus. Using Docker Compose keeps our deployment clean and manageable. First, create a directory for your monitoring stack and create a docker-compose.yml file. Add the following YAML configuration to define the Prometheus service:

services:
  prometheus:
    image: prom/prometheus
    container_name: prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
    ports:
      - 9090:9090
    restart: unless-stopped
    volumes:
      - ./prometheus:/etc/prometheus
      - prom_data:/prometheus
volumes:
  prom_data:

Next, you need to create the configuration file that Prometheus will read upon startup. Create a folder named prometheus in the same directory, and inside it, create a file named prometheus.yml. Paste the exact configuration below:

global:
  scrape_interval: 15s
  scrape_timeout: 10s
  evaluation_interval: 15s
alerting:
  alertmanagers:
    - static_configs:
      - targets: []
      scheme: http
      timeout: 10s
      api_version: v2
scrape_configs:
  - job_name: prometheus
    honor_timestamps: true
    scrape_interval: 15s
    scrape_timeout: 10s
    metrics_path: /metrics
    scheme: http
    static_configs:
      - targets:
        - localhost:9090
  - job_name: home_lab
    static_configs:
      - targets: ['<Server_IP>:9100']

This configuration file tells Prometheus how often to scrape data and where to look. We have two jobs defined: one for Prometheus itself, and another called home_lab for our host machine. Please note that the original sample uses the private IP <Server_IP>. You should replace this target IP address with your own server's IP address.

Prometheus target health shows both Prometheus and the home_lab Node Exporter target as UP.

Prometheus target health shows both Prometheus and the home_lab Node Exporter target as UP.

Note: If you check your Prometheus targets (at http://SERVER_IP:9090/targets) and see that targets are DOWN, verify your firewall rules, ensure the correct IP and port are configured in your YAML file, and check whether Node Exporter is actually running on the target machine.

Step 2 — Install Node Exporter as a systemd service

Node Exporter is a lightweight binary that pulls hardware and OS metrics. While you can run it inside a Docker container, it is often more convenient and effective to run it natively on the host system as a systemd service so it has direct access to the kernel and hardware statistics without container boundaries.

Execute the following commands sequentially to download, extract, and install the binary:

wget https://github.com/prometheus/node_exporter/releases/download/v1.11.1/node_exporter-1.11.1.linux-amd64.tar.gz
tar xvf node_exporter-1.11.1.linux-amd64.tar.gz
cd node_exporter-1.11.1.linux-amd64
sudo cp node_exporter /usr/local/bin
sudo useradd --no-create-home --shell /bin/false node_exporter
sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter
sudo nano /etc/systemd/system/node_exporter.service

In the text editor, paste the following systemd service configuration exactly as shown:

[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
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

Save the file and exit your editor. Then, run the following commands to reload systemd, enable the service to start on boot, start it immediately, and check its status:

sudo systemctl daemon-reload
sudo systemctl enable node_exporter
sudo systemctl start node_exporter
sudo systemctl status node_exporter.service

Node Exporter running as an active systemd service.

Node Exporter running as an active systemd service.

Tip: You can open http://SERVER_IP:9100/metrics in any web browser to confirm that the raw, text-based metrics are successfully being exposed by the Node Exporter.

Prometheus target health shows both Prometheus and the home_lab Node Exporter target as UP.

Prometheus target health shows both Prometheus and the home_lab Node Exporter target as UP.

Step 3 — Deploy Grafana with Docker Compose

Now that Prometheus is successfully scraping data, we need Grafana to visualize it. We will append Grafana to our existing Docker Compose setup. Open your docker-compose.yml file and update it so that it includes the Grafana service:

version: "13.0.2"
services:
  grafana:
    image: grafana/grafana
    container_name: grafana
    restart: unless-stopped
    ports:
     - '3000:3000'
    volumes:
      - grafana-storage:/var/lib/grafana
volumes:
  grafana-storage: {}

This configuration pulls the official Grafana image, maps port 3000, and mounts a volume to persist your dashboard data even if the container is rebuilt.

Editor’s Note: Newer Docker Compose versions may warn you that the version attribute at the top of the file is obsolete. If you see this warning, you can safely remove the version line to adhere to modern Compose specifications.

Prometheus container started successfully with Docker Compose.

Prometheus container started successfully with Docker Compose.

Run docker compose up -d to spin up the new Grafana container.

Grafana login page after the container is started.

Grafana login page after the container is started.

Grafana home screen after signing in.

Grafana home screen after signing in.

Navigate to http://SERVER_IP:3000 in your browser. You can log in with the default Grafana credentials (usually admin / admin) if they are unchanged. It is highly recommended that you immediately change the admin password when prompted, especially if this server is accessible from outside a private network.

Step 4 — Add Prometheus as a Grafana data source

Grafana does not store data; it relies on external data sources. Let’s link our newly running Prometheus instance to Grafana so we can start generating graphs.

Add a new data source in Grafana and choose Prometheus.

Add a new data source in Grafana and choose Prometheus.

Configure the Prometheus data source and point Grafana to the Prometheus server URL.

Configure the Prometheus data source and point Grafana to the Prometheus server URL.

Review the lower data source options before testing the connection.

Review the lower data source options before testing the connection.

Grafana successfully queried the Prometheus API.

Grafana successfully queried the Prometheus API.

In the data source configuration screen, you must enter the HTTP URL for Prometheus. In this specific home lab setup, the URL is [http://<S](http://SERVER)erver_IP>:9090. Make sure to replace this IP address with the actual address of your server. Once entered, click "Save & Test" to ensure Grafana can communicate with the Prometheus API.

Step 5 — Import the Node Exporter Full dashboard

Building comprehensive dashboards from scratch can be time-consuming. Fortunately, Grafana Labs hosts a vast repository of community-created, reusable dashboards. For server monitoring, the “Node Exporter Full” dashboard is incredibly popular and comprehensive. Its Grafana.com ID is 1860.

From Dashboards, choose New → Import.

From Dashboards, choose New → Import.

Use dashboard ID 1860 to load the Node Exporter Full dashboard from Grafana.com.

Use dashboard ID 1860 to load the Node Exporter Full dashboard from Grafana.com.

The Grafana.com dashboards gallery includes Node Exporter Full.

The Grafana.com dashboards gallery includes Node Exporter Full.

Node Exporter Full dashboard page on Grafana.com.

Node Exporter Full dashboard page on Grafana.com.

Import the dashboard and confirm the name, folder, and UID options.

Import the dashboard and confirm the name, folder, and UID options.

When you click “Load” after entering the ID, Grafana will fetch the dashboard layout. You will be prompted to assign it to a folder and, most importantly, select the Prometheus data source you created in the previous step from a dropdown menu. Select your “home_lab” (or similarly named) Prometheus connection and click “Import”.

Step 6 — View the finished dashboard

Node Exporter Full dashboard showing CPU, memory, disk, and network metrics.

Node Exporter Full dashboard showing CPU, memory, disk, and network metrics.

Upon importing, you will immediately be presented with a rich interface displaying your host’s metrics. This dashboard neatly categorizes vital statistics including CPU utilization, memory consumption, disk space and IO limits, and network traffic over time. Monitoring these trends helps you baseline normal system behavior, making it much easier to detect anomalies or resource exhaustion before they cause a critical failure.

Conclusion

Setting up a comprehensive monitoring solution for your server does not require expensive enterprise software. By utilizing Docker Compose to spin up Prometheus and Grafana, and deploying Node Exporter via systemd, you establish a resilient, highly visible overview of your hardware’s health in minutes. With the foundational data flowing into your beautiful Grafana dashboards, your next steps could include configuring Alertmanager to send Slack or email notifications when CPU spikes, adding more Node Exporters for other servers in your network, or integrating application-level metrics to monitor your distinct software stacks.


메타데이터
post_id
c68b61fb06d9
slug
monitoring-a-home-server-with-prometheus-grafana-and-node-exporter-c68b61fb06d9
url
https://medium.com/@mahimsec/monitoring-a-home-server-with-prometheus-grafana-and-node-exporter-c68b61fb06d9
canonical_url
https://medium.com/@mahimsec/monitoring-a-home-server-with-prometheus-grafana-and-node-exporter-c68b61fb06d9
author_url
https://medium.com/@mahimsec
status
ok
fetched_at
2026-06-22 19:40:15