Technical Tutorials
VPS Monitoring and Alerting System Setup (2025) - Professional Prometheus + Grafana Solution
The latest 2025 guide to comprehensive VPS monitoring. Learn to build a professional-grade monitoring system with Prometheus + Grafana and Node Exporter to track server load in real time.

Your VPS is like a race car speeding down the highway. If you don't keep an eye on the dashboard (CPU, memory, bandwidth), it will be too late by the time the engine blows (the server goes down).
For serious VPS users, manually checking status with just the top command is not enough. We need a professional, automated, visual monitoring system. This article walks you through building your own VPS flight dashboard using the industry-recognized golden trio: Prometheus + Grafana + Node Exporter.
- Node Exporter (Collector): Installed on the VPS, it is responsible for scraping system metrics (CPU usage, free disk space, network traffic, etc.).
- Prometheus (Storage Center): Like a "monitoring recorder," it periodically pulls data from Node Exporter and stores it.
- Grafana (Presentation Layer): The most beautiful monitoring dashboard, responsible for turning the cold, hard data in Prometheus into elegant charts and alert messages.
In 2025, we still strongly recommend deploying with Docker Compose. This keeps your system environment clean and lets you manage all components with a single command.
Create a directory and enter it:
mkdir vps-monitor && cd vps-monitor
Create docker-compose.yml:
services:
prometheus:
image: prom/prometheus:v3.1.0 # 建议锁定版本
container_name: prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
restart: always
node-exporter:
image: prom/node-exporter:v1.8.2
container_name: node-exporter
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)'
restart: always
grafana:
image: grafana/grafana:11.4.0
container_name: grafana
ports:
- "3000:3000" # 仪表盘访问端口
volumes:
- grafana_data:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=your_secure_password # 设置初始密码
restart: always
volumes:
prometheus_data:
grafana_data:
In the same directory, create the prometheus.yml configuration file:
global:
scrape_interval: 15s # 每 15 秒拉取一次数据
scrape_configs:
- job_name: 'vps-status'
static_configs:
- targets: ['node-exporter:9100'] # 指向同一个 Docker 网络里的采集器
Start all services:
docker compose up -d
- Visit
http://你的IP:3000and log in with the password you just set. - Add a data source: In the left menu, go to
Connections->Data sources->Add data source, and select Prometheus. - Fill in the address: Enter
http://prometheus:9090in the URL field, then clickSave & testat the bottom. - Import a classic template:
- Click the
+icon in the top right ->Import. - Enter
1860in the ID field (this is the most classic all-in-one Node Exporter dashboard). - Click
Load, select the Prometheus data source you just created, and clickImport.
- Click the
Instantly, your VPS load, traffic, and disk IO will be displayed before you with stunning visualizations!
Looking at charts is not enough. We need the VPS to proactively notify us when something goes wrong.
In Grafana, you can set up Alerts directly:
- Go to Grafana's
Alerting->Alert rules. - Create a rule: For example, set "disk space < 10%" or "average load > 0.8".
- Configure a channel: You can connect a Telegram Bot or a Feishu/DingTalk webhook. That way, when VPS traffic spikes abnormally or the disk is almost full, your phone will receive a push notification immediately.
A server without monitoring is like running blind. With Prometheus + Grafana, you can not only see the server's status in real time, but also step in before a failure happens (for example, when memory keeps growing).
Pro Tip: If you have multiple VPS instances, simply run a separate
node-exportercontainer on each of the other VPS instances, then add their IPs to theprometheus.ymlon the main control node to achieve aggregated multi-machine monitoring.