A VPS can look fine from the outside while CPU, RAM, or disk quietly runs out, and the first sign of trouble is often a message from a user. A prometheus grafana monitoring stack fixes that gap: Prometheus collects numbers from your server on a schedule, stores them, and checks them against rules, while Grafana turns those numbers into charts you can read at a glance. You can build the pair on one VPS in an afternoon.
Build a prometheus grafana monitoring stack on one VPS
The stack has three moving parts, and each one does a single job. Prometheus scrapes metrics from targets at a set interval, usually every 15 seconds, and keeps the results in its own time-series store. Node Exporter runs on each machine you watch and exposes system numbers such as CPU load, memory use, disk space, and network traffic in a format Prometheus can read. Grafana connects to Prometheus as a data source and draws the charts, and it also sends alerts when a rule fires. Keep all three on the same VPS for a first setup.
Plan the resource cost before you install anything. Prometheus with a 15-day retention on a single server uses a modest amount of disk, often a few hundred megabytes, and Grafana uses little RAM when idle. Set retention in the Prometheus config so the disk does not grow without a limit. A prometheus grafana vps setup works well on a 2 GB VPS alongside a small app, but if the same server already runs a heavy database, give monitoring its own small VPS. For a wider comparison before you commit, read this guide to Prometheus versus Zabbix versus Checkmk in 2026.
What each piece does
Prometheus pulls metrics instead of waiting for machines to push them, which makes it easy to see when a target stops answering: a missing scrape is itself a signal. It stores each metric as a time series with labels, so you can ask for CPU use on one host, or for disk use across all hosts, with the same query language, PromQL. Node Exporter is a small binary with no config file of its own; it reads numbers from the operating system and serves them on port 9100. Grafana is the face of the stack: dashboards, alert rules, and user logins live there.
Install Prometheus and Node Exporter
Install both from the official release archives so you control the version, and run them as a dedicated system user with a systemd service each. The commands below download the current release, place the binaries in a standard path, and create the user and directories.
sudo useradd --no-create-home --shell /usr/sbin/nologin prometheus cd /tmp curl -LO https://github.com/prometheus/prometheus/releases/download/v3.0.0/prometheus-3.0.0.linux-amd64.tar.gz tar xvf prometheus-3.0.0.linux-amd64.tar.gz sudo cp prometheus-3.0.0.linux-amd64/prometheus /usr/local/bin/ sudo mkdir -p /etc/prometheus /var/lib/prometheus sudo chown -R prometheus:prometheus /etc/prometheus /var/lib/prometheus
Do the same for Node Exporter, then create a Prometheus config file that lists the local exporter as a target. The config below scrapes the exporter every 15 seconds and keeps data for 15 days, which is a sensible start for one server. After you write the config, check it with promtool check config /etc/prometheus/prometheus.yml before you start the service, because a syntax error at this stage is far easier to fix than a silent failure later.
# /etc/prometheus/prometheus.yml
global:
scrape_interval: 15s
storage:
tsdb:
retention: 15d
scrape_configs:
- job_name: "node"
static_configs:
- targets: ["localhost:9100"]
Create a systemd unit for each service, enable them, and open the Prometheus web UI at port 9090 through an SSH tunnel. Check the Targets page in the UI: the node job should show as up, with a recent scrape time. If it shows as down, check that Node Exporter is listening on port 9100 and that the firewall allows localhost traffic. For a larger setup with containers, this guide to monitoring Kubernetes with Prometheus and Grafana shows how the same pieces fit a cluster.
Add Grafana and connect the data source
Grafana ships as a package for Ubuntu, and the install adds its own service and a default admin login you must change on first use. Install it from the official Grafana apt repository, start the service, and open the web UI on port 3000. Log in, change the admin password right away, and add Prometheus as a data source with the URL http://localhost:9090.
sudo apt install -y apt-transport-https software-properties-common curl -fsSL https://apt.grafana.com/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/grafana.gpg echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list sudo apt update sudo apt install grafana -y sudo systemctl enable --now grafana-server
Put Grafana behind a reverse proxy with HTTPS, restrict port 3000 in the firewall, and create a viewer user for anyone who only needs to look at dashboards.
Build dashboards that answer real questions
A good dashboard answers four questions in one screen: is the server up, is it busy, is it running out of something, and is traffic normal. Start with panels for CPU load, memory use, disk free space, and network traffic, then add panels for the app itself, such as request rate or error rate if your app exposes them. Grafana ships with a ready-made Node Exporter dashboard you can import by its ID, which gives you a working starting point in minutes. Use PromQL queries that match the question you are asking: CPU use comes from node_cpu_seconds_total, memory from node_memory_MemAvailable_bytes, and disk free space from node_filesystem_avail_bytes. Keep each panel to one idea and set the time range to the last six hours by default. Grafana dashboards server monitoring work is done when you can open the page and say, in ten seconds, whether the server is healthy or not.
Alerts that reach you before users complain
Write alerts for the failures that matter and that you can act on: disk filling up, memory running out, the server going down, and a service stopping. A disk alert at 80 percent full gives you time to act, while an alert at 98 percent is a race. A load alert that fires on a short spike will wake you for nothing, so add a duration, such as five minutes above the threshold, before the alert fires. The Prometheus rule below warns when a filesystem has less than 20 percent free for five minutes. The vps monitoring metrics alerts you set will depend on these same queries, so write them carefully.
# /etc/prometheus/rules.yml
groups:
- name: vps
rules:
- alert: DiskFillingUp
expr: (node_filesystem_avail_bytes / node_filesystem_size_bytes) < 0.2
for: 5m
labels:
severity: warning
Load the rule file from the Prometheus config, check it with promtool check rules, and reload Prometheus. In Grafana, create a contact point for your email or chat webhook and test it by lowering a threshold on purpose for ten minutes. For the basics of watching a server without a full stack, these Linux server monitoring basics cover the commands and habits that sit underneath any tool.
Keep the stack itself healthy
Monitoring that nobody maintains becomes a second problem. Check once a week that Prometheus is scraping, that Grafana opens, and that the alert channel still works. Watch the disk use of the Prometheus data directory, and lower retention or add disk before it fills. Back up the Prometheus config, the rule files, and the Grafana dashboards by exporting them to a file and storing that file with your other server notes. Update Prometheus and Grafana on a schedule, reading the release notes first. Before you pick a different tool for a second server, compare the lighter options in this guide to the best VPS monitoring tools: Netdata, Zabbix, and HetrixTools.
Your next step is a single working loop: one exporter, one dashboard with four panels, and one alert you have seen fire in a test.