VPS

How to Monitor Your VPS: CPU, RAM, Disk and Uptime

12 min read

How to Monitor Your VPS: CPU, RAM, Disk and Uptime

The Short Answer

You cannot fix a problem you do not know about. A good VPS monitoring setup answers three questions at all times: is the server up, is it healthy (CPU, RAM, disk), and will I be told the moment something breaks? This guide builds that in layers: instant health checks you run by hand, free external uptime monitoring that alerts you within minutes, and optional self-hosted dashboards for the full picture. Total setup time is under an hour, and most of it is free.

Monitoring pairs naturally with the rest of server ownership: if you have not secured the server yet, start with How to Secure Your VPS, and if performance is the concern, How to Speed Up Your VPS shows how to act on what monitoring reveals.

Layer 1: Instant Health Checks (No Setup Required)

Before installing anything, learn the four commands that tell you the server’s current state. Run them over SSH whenever something feels wrong.

Overall load and uptime:

uptime

The three load-average numbers are the 1, 5 and 15-minute averages of runnable processes. As a rule of thumb, sustained load above the number of vCPUs means processes are queuing. A 2-vCPU server showing load average: 4.12, 3.98, 3.50 is overloaded; the same server at 0.40, 0.35, 0.30 is mostly idle.

CPU and RAM per process:

htop

Install it if missing: sudo apt install htop. The top bars show CPU per core and memory usage at a glance; the process list below is sortable by CPU (F6, then select PERCENT_CPU) or memory. The process at the top during a slowdown is usually your culprit. Press q to quit.

Disk space and inodes:

df -h
df -i

df -h shows disk usage by filesystem; anything over 85% deserves attention, over 95% is an emergency. df -i shows inode usage — a disk can run out of inodes (file slots) while still showing free space, typically caused by millions of tiny files such as session files or cache fragments.

Disk I/O:

iostat -x 1 3

(Install with sudo apt install sysstat.) Watch %util (how busy the disk is) and await (average wait time in milliseconds). Sustained %util near 100% with high await means the disk is the bottleneck — the server is waiting on storage, not CPU.

Memory detail:

free -h

Focus on the “available” column, not “free”: Linux uses spare RAM for disk caching, so “free” is often near zero on a healthy server. If “available” is near zero and swap is in heavy use, the server needs more RAM — see How to Upgrade Your VPS.

Layer 2: External Uptime Monitoring (The Alert That Wakes You)

On-server tools only help when you are looking. External monitoring watches from the outside and alerts you the moment the site goes down — including when the whole server is unreachable, which no on-server tool can report.

UptimeRobot is the standard free choice: its free plan covers 50 monitors checked every 5 minutes, with email alerts (checked 23 November 2026). Setup takes five minutes:

  1. Create a free account at uptimerobot.com.
  2. Add a monitor: type HTTP(S), friendly name, and your site’s URL.
  3. Add a second monitor for a keyword check — for example, monitor https://yourdomain.com for a word that appears on the homepage, which catches the case where the server responds but WordPress is showing an error page.
  4. Add a port monitor for SSH (port 22) if you want to know when the server itself is unreachable rather than just the website.
  5. Set your alert contacts — email at minimum; the mobile app gives push notifications.

The 5-minute interval means an outage can go unnoticed for up to 5 minutes. That is fine for a blog or small business site; if you need faster detection, paid plans check every 60 seconds. Alternatives with free tiers include Better Stack (10 monitors free) and Hyperping (20 monitors free) — the shape of the setup is the same.

What to monitor: your homepage, your checkout or signup page if you have one, and the server’s SSH port. Three monitors cover the failures that matter. Also monitor your SSL certificate expiry — UptimeRobot’s free plan does not include SSL monitoring, so add a calendar reminder 60 days after issuance, or use a dedicated free checker such as the SSL expiry monitor in Better Stack’s free tier.

Test your alerts. After setting up monitoring, deliberately stop your web server for a minute (sudo systemctl stop nginx, wait, then start it again) and confirm the alert arrives. An alert system you have never seen fire is an untested system — and untested systems fail silently.

Layer 3: Resource Alerts (Know Before It Breaks)

Uptime monitoring tells you when the site is down. Resource monitoring tells you it is about to go down — disk filling up, memory exhausted, CPU pegged. The simplest approach is a small script plus cron, with email alerts.

First, make sure the server can send email. Ubuntu’s mail command needs a mail setup; the simplest reliable path is an SMTP relay. If you have not configured mail, install msmtp and point it at a transactional email service, or use a webhook to a messaging service instead. For this guide we will use a webhook example, since it needs no mail server.

Disk-space alert script:

sudo nano /usr/local/bin/check-disk.sh
#!/bin/bash
USAGE=$(df / | awk 'NR==2 {print $5}' | tr -d '%')
THRESHOLD=85
if [ "$USAGE" -ge "$THRESHOLD" ]; then
  curl -s -X POST "https://api.telegram.org/botYOUR_BOT_TOKEN/sendMessage" \
    -d chat_id=YOUR_CHAT_ID \
    -d text="WARNING: Disk usage on $(hostname) is at ${USAGE}%"
fi

Make it executable and run it hourly:

sudo chmod +x /usr/local/bin/check-disk.sh
sudo crontab -e
0 * * * * /usr/local/bin/check-disk.sh

The same pattern works for memory (parse free), load average (parse uptime), and service status (systemctl is-active nginx). Telegram bots are free and take five minutes to set up via BotFather; Discord webhooks and Slack webhooks work the same way with a different URL. Pick whichever messaging app you actually check — an alert to an inbox you never open is no alert at all.

Layer 4: Dashboards (See the Whole Picture)

When you want history — not just “is it up now” but “when did the CPU spike, and what was running” — you need a dashboard that records metrics over time.

Netdata (quickest real-time dashboard)

Netdata installs in one command and gives a detailed real-time dashboard on port 19999:

curl https://get.netdata.cloud/kickstart.sh > /tmp/netdata-kickstart.sh
sh /tmp/netdata-kickstart.sh

After installation, open http://YOUR_SERVER_IP:19999. You get per-second CPU, RAM, disk, network and per-process graphs, plus pre-configured alarms. Netdata uses roughly 100–200 MB of RAM — acceptable on a 2 GB server, heavy on a 512 MB one.

Do not leave a monitoring dashboard open to the internet. Netdata’s dashboard shows detailed system information. Bind it to localhost and reach it over SSH (ssh -L 19999:localhost:19999 user@server), or protect it with a firewall rule that allows only your IP, or put it behind basic authentication in Nginx. An exposed dashboard is a reconnaissance gift to attackers.

Uptime Kuma (self-hosted uptime monitoring)

If you prefer to self-host instead of using UptimeRobot, Uptime Kuma is a polished open-source monitor with a web dashboard, status pages and dozens of notification integrations. The simplest install is Docker (see How to Install Docker on a VPS):

docker run -d --restart=always -p 3001:3001 \
  -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1

Open http://YOUR_SERVER_IP:3001, create an admin account, and add monitors. One caveat: a self-hosted monitor running on the same server it monitors cannot alert you when that server dies. Run Uptime Kuma on a second cheap server (or a free-tier instance) if you want it to catch total outages — or use it alongside an external service like UptimeRobot rather than instead of it.

Prometheus + Grafana (for larger setups)

For multiple servers or deep custom metrics, Prometheus (collection) plus Grafana (visualisation) is the industry standard. It is also the heaviest option: Prometheus needs a few hundred megabytes of RAM and real configuration effort. It is the right choice when you manage several servers and want one dashboard for all of them; it is overkill for a single VPS, where Netdata or a hosted service covers the need.

Watching Logs (Where Problems Announce Themselves)

Dashboards show numbers; logs show reasons. Three log habits worth building:

Follow a service’s live log:

sudo journalctl -u nginx -f
sudo journalctl -u mysql -f

Check for errors since the last boot:

sudo journalctl -p err -b

Watch authentication attempts (who is trying to break in):

sudo grep "Failed password" /var/log/auth.log | tail -20

If fail2ban is installed (see How to Secure Your VPS), it is already banning the worst offenders; the log tells you the scale of the attempts. A sudden spike in failed logins from one country or IP range is worth a look, though for most servers it is background noise.

For a WordPress site, also watch the PHP-FPM error log (/var/log/php8.3-fpm.log) and the Nginx error log (/var/log/nginx/error.log) after any change. Most “the site broke after I changed X” mysteries are answered in the first ten lines of the error log.

A Sensible Monitoring Stack (Summary)

Layer Tool Cost What it catches
Instant checks htop, df, iostat, free Free Current CPU/RAM/disk state
Uptime alerts UptimeRobot (50 monitors, 5-min checks) Free Site or server down
Resource alerts Cron script + Telegram/Discord Free Disk filling, memory pressure
Dashboard Netdata Free Real-time history and alarms
Self-hosted uptime Uptime Kuma Free (needs a 2nd server to be useful) Downtime with a status page
Logs journalctl, auth.log Free Errors and intrusion attempts

Start with layers 1 and 2 — they take 15 minutes and cover the failures that cost you visitors. Add layer 3 when you have been bitten once by a full disk. Add a dashboard when you want to understand why something happened, not just that it happened.

Troubleshooting

“UptimeRobot says the site is down but it loads fine for me.” Check the monitor’s URL — a typo, an http:// URL that now redirects, or a keyword that no longer appears on the page all cause false downs. Also check whether your server blocks the monitor’s IP addresses: some firewalls and security plugins treat repeated checks as an attack. Whitelist UptimeRobot’s IPs if your firewall logs show blocked requests from them.

“htop shows high CPU but I don’t know which process is responsible.” Sort by CPU (F6 → PERCENT_CPU) and look at the top entries. Common surprises: a runaway cron job, a backup running at the wrong hour, or a crypto miner installed through a compromised plugin — a process using 100% CPU with an unfamiliar name deserves investigation, not a shrug.

“df shows the disk full but du can’t find the files.” Deleted files held open by a running process still occupy space. Find them with sudo lsof | grep deleted and restart the holding service to release the space. Log files deleted while a service still writes to them are the classic case.

“Netdata won’t load on port 19999.” Check the service (sudo systemctl status netdata), the firewall (sudo ufw allow 19999/tcp — or better, use the SSH tunnel method described above), and the provider’s cloud firewall. Also confirm Netdata bound to the right address: its default configuration listens on all interfaces, but a hardened setup may restrict it to localhost.

“Alerts arrive hours late.” Email alerts can be delayed by greylisting or spam filtering — check the spam folder and the sending service’s reputation. Push notifications (UptimeRobot app, Telegram) are usually faster and more reliable than email for urgent alerts. If you use email, add the sender to your contacts.

Frequently Asked Questions

How often should monitoring check my site?

Every 5 minutes is fine for a blog or small business site — it is UptimeRobot’s free interval and catches anything lasting longer than a few minutes. Every 60 seconds suits a store or SaaS where minutes of downtime cost money. Below 60 seconds is for services with strict availability requirements, and the check itself starts to become measurable load.

Do I need monitoring if my provider has a status page?

Yes — the provider’s status page reports their infrastructure, not your server. Your site can be down (crashed PHP, full disk, expired certificate) while the provider reports all systems green. External monitoring of your own URL is the only check that reflects what your visitors experience.

Will monitoring slow down my VPS?

Negligible impact. External checks are a handful of HTTP requests every few minutes. Netdata uses some RAM and CPU (roughly 100–200 MB RAM, a few percent of one core) — noticeable on a 512 MB server, irrelevant on 2 GB or more. The cron alert scripts use essentially nothing.

What is the difference between uptime monitoring and resource monitoring?

Uptime monitoring asks “can visitors reach the site?” from outside. Resource monitoring asks “how is the server doing?” from inside. You need both: a server can be up but unhealthy (disk 99% full, about to crash), or healthy but unreachable (a network or DNS problem). The two together give the full picture.

Should I monitor a server that only runs a VPN or game server?

Yes, with adjusted targets. For a VPN, monitor the WireGuard port (UDP 51820 by default) and the server’s SSH port. For a game server, monitor the game port and set up disk and memory alerts — a full disk kills a Minecraft world as surely as it kills a website. See How to Create a VPN on Your VPS with WireGuard and How to Host a Minecraft Server on a VPS.

How do I get alerted if the whole data center goes down?

Use an external service (UptimeRobot, Better Stack) whose checkers run in multiple regions — they will notice your server is unreachable regardless of the cause. A self-hosted monitor on the same server cannot do this, which is why the free external tier is the foundation of the whole setup, not an optional extra.

The Bottom Line

Fifteen minutes buys you the essentials: UptimeRobot watching your site from outside, plus the habit of checking htop and df when something feels off. Add disk alerts and a dashboard as you grow. The goal is simple — never learn about an outage from a visitor.

Leave a Reply

Your email address will not be published. Required fields are marked *