
Most “monitoring” setups fail in a boring way. You get a ping alert. Then you SSH in too late and guess.
This server monitoring setup guide tutorial shows you how to build a live Linux health dashboard with Netdata, add alerts you can act on, and lock it down. It’s safe for a hosting VPS or dedicated server.
Ubuntu Server 24.04 LTS is the main example. The same flow works on Debian 12, AlmaLinux 9/10, and Rocky Linux.
By the end, you’ll have two things:
- (1) a dashboard that quickly surfaces CPU steal, disk latency, PHP-FPM pressure, and network drops
- (2) alerts that point to the failure mode instead of vaguely reporting “down.”
What you’ll build (and what you should have first)
- Netdata installed on a single VPS/dedicated server, with a browser dashboard
- Alerts routed to email (and optionally a webhook) with sensible thresholds
- Secure access via firewall allowlist and reverse proxy authentication (so you don’t expose a stats UI to the internet)
- Basic diagnostics that map charts to common hosting failures: disk-full, I/O wait, PHP worker saturation, and noisy bot traffic
Prereqs
- Root or sudo access
- One public IP (or private network/VPN access)
- Outbound email working (or a relay) if you want email alerts
If you’re provisioning a fresh server for this, a HostMyCode VPS is a straightforward fit for small to mid-size sites.
If you’d rather not own patching and security baselines, managed VPS hosting keeps the day-2 work off your plate.
Step 1 — Install Netdata on Ubuntu 24.04 (the safe, repeatable way)
Netdata’s upstream installer is the quickest way to get current builds. It also keeps upgrades predictable. Distro packages often lag.
sudo apt update
sudo apt -y install curl ca-certificates
curl -sS https://get.netdata.cloud/kickstart.sh | sudo sh
After the install, Netdata runs as a systemd service.
sudo systemctl status netdata --no-pager
sudo ss -lntp | grep 19999 || true
By default, Netdata listens on port 19999. Leave it closed to the public internet for now.
Secure access first. Then expose it in a controlled way.
Step 2 — Restrict dashboard access (firewall allowlist first)
On a hosting server, treat monitoring endpoints like an admin panel. Start by limiting who can reach it.
If you use UFW:
sudo ufw status verbose
# Allow Netdata only from your office/home IP
sudo ufw allow from 203.0.113.10 to any port 19999 proto tcp
# Do NOT run: sudo ufw allow 19999/tcp
If firewall edits have ever locked you out, keep this nearby: firewall troubleshooting steps for SSH and web recovery.
On AlmaLinux/Rocky (firewalld):
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="203.0.113.10" port protocol="tcp" port="19999" accept'
sudo firewall-cmd --reload
Step 3 — Put Netdata behind Nginx with basic auth (recommended)
Allowlisting helps, but it’s not enough on its own. Putting Netdata behind Nginx adds authentication, clean URLs, and TLS termination.
It also lets you keep 19999 private.
Install Nginx and Apache tools (for htpasswd):
sudo apt -y install nginx apache2-utils
Create a password file:
sudo htpasswd -c /etc/nginx/.htpasswd netdataadmin
Create an Nginx site:
sudo nano /etc/nginx/sites-available/netdata
server {
listen 80;
server_name monitor.example.com;
location / {
auth_basic "Netdata";
auth_basic_user_file /etc/nginx/.htpasswd;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_pass http://127.0.0.1:19999;
}
}
Enable the site and reload:
sudo ln -s /etc/nginx/sites-available/netdata /etc/nginx/sites-enabled/netdata
sudo nginx -t
sudo systemctl reload nginx
At this point, keep port 19999 blocked publicly. Expose only monitor.example.com through standard web controls and TLS.
If you’re adding a new monitoring subdomain during a low-downtime cutover, this helps: DNS propagation and TTL planning for clean cutovers.
Step 4 — Add TLS (Let’s Encrypt) so credentials aren’t sent in cleartext
Basic auth without TLS is a non-starter. Use Certbot with Nginx:
sudo apt -y install certbot python3-certbot-nginx
sudo certbot --nginx -d monitor.example.com
Certbot updates your server block and sets up renewal timers. Confirm renewals work:
sudo certbot renew --dry-run
Running cPanel? The workflow is different. Use this reference instead: cPanel SSL certificate management in 2026.
Step 5 — Make Netdata charts “hosting-aware” (disable noise, focus on what breaks sites)
Netdata collects a lot of data by default. That’s useful. It can also bury the charts you need during an incident.
Your goal is simple: decide whether you’re compute-bound, memory-bound, or I/O-bound within a minute.
Two fast checks worth building muscle memory around:
- CPU steal (virtualization contention): spikes often explain “random” slowdowns on busy nodes
- Disk latency (I/O wait): log floods and database churn can stall PHP and web requests
Practical tweak: keep Netdata’s history reasonable. You don’t want it competing with your workload. Edit:
sudo nano /etc/netdata/netdata.conf
Set a sensible in-memory history. Example for small VPS:
[global]
history = 3600
update every = 1
Apply changes:
sudo systemctl restart netdata
Don’t paste that and forget it. On a 1 GB RAM VPS, one hour of 1-second metrics is usually enough.
On a 16–64 GB dedicated box, you can afford more history.
Step 6 — Turn on email alerts the sane way (and prove they work)
Netdata includes alerting out of the box. Two classic failures show up fast.
One: you generate so many alerts that you stop reading them. Two: you send from a server that can’t deliver mail consistently.
First, pick your email delivery approach:
- Small server or WordPress host: use an SMTP relay so alerts don’t vanish into spam filters
- Mail-focused server: send directly, but only if DNS and reputation are in good shape
If you’re not already using a relay, follow: SMTP relay setup with Postfix + TLS. It’s the quickest way to make “alerts by email” dependable.
On Ubuntu, Netdata typically uses /etc/netdata/health_alarm_notify.conf. Edit it:
sudo nano /etc/netdata/health_alarm_notify.conf
Enable email and set recipients (example):
SEND_EMAIL="YES"
DEFAULT_RECIPIENT_EMAIL="ops@example.com"
Then test the notifier:
sudo -u netdata /usr/libexec/netdata/plugins.d/alarm-notify.sh test
If the test fails, fix mail delivery first.
Don’t build “monitoring” on top of a mail setup you don’t trust.
Step 7 — Tune alerts so they trigger on real incidents (disk, load, RAM, and web stack pressure)
Netdata alert rules live in /etc/netdata/health.d/. You can override defaults without getting into upgrade fights.
Create your own file for the rules you actually care about.
Example: add a custom disk-space alert that makes sense for hosting accounts and backups. Start by checking mounts:
df -hT
Then create a custom rule file:
sudo nano /etc/netdata/health.d/custom-disk-space.conf
alarm: custom_disk_space_root
on: disk_space._
lookup: average -1m percentage
every: 1m
warn: $this > 85
crit: $this > 92
info: Root filesystem space is running low
to: sysadmin
Reload Netdata:
sudo systemctl restart netdata
Those thresholds are conservative on purpose. Once you’re under ~10% free, logs, temp files, and backups can push you into “No space left on device” fast.
For a step-by-step recovery playbook, use: disk space troubleshooting for hosting VPS.
Good alert targets for web hosting servers:
- Disk space: root volume + any separate volume for
/homeor/var - Disk latency: sustained I/O wait predicts “site is slow” better than CPU in many real outages
- RAM pressure: watch swap-in activity; occasional swap happens, constant swap hurts
- Network errors: drops and retransmits can masquerade as app bugs
Step 8 — Add quick “triage views”: mapping Netdata charts to common tickets
Monitoring pays off when it cuts diagnosis time. Use this cheat sheet during incidents.
It keeps you from bouncing between tools.
Ticket: “The website is slow”
- Check system load vs CPU usage. If load is high but CPU isn’t, suspect I/O wait.
- Check disk latency and iowait. Spikes often line up with log storms, backups, or a filling disk.
- Check network for retransmits if pages hang mid-load.
If you want a structured flow that pairs metrics with Linux commands, this complements Netdata well: diagnose slow website response on Ubuntu.
Ticket: “502/504 errors”
- Look for RAM exhaustion or process limits (PHP-FPM children maxed out, Apache workers saturated).
- Check CPU steal on virtualized hosts if the server looks “fine” but requests stall.
- Correlate with deploys, cron jobs, and backup windows.
Ticket: “Email is delayed”
- Look for disk I/O (mail queues and logs are I/O-heavy).
- Confirm outbound connectivity and DNS health.
- Check whether the queue is growing faster than it drains.
For mail-specific diagnostics, keep this one handy: fix a stuck Postfix mail queue.
Step 9 — Hardening checklist for monitoring on a VPS or dedicated server
Netdata isn’t the risky piece. The risk comes from dashboards that stay exposed and forgotten.
- Don’t expose port 19999 publicly. Keep it bound to localhost and proxy through Nginx.
- Require authentication. Basic auth is fine with TLS; SSO is better if you already run it.
- Allowlist admin IPs at the firewall. This blocks most random credential spraying.
- Keep the server patched. Monitoring doesn’t help if the box is compromised.
- Log access to the dashboard. Nginx access logs give you traceability.
If SSH isn’t locked down yet, do that before you call the server “production.” This guide is a solid baseline: secure VPS login with SSH keys and safe sudo defaults.
Step 10 — Back up the monitoring config (so rebuilds take minutes, not hours)
Monitoring configs are small. They’re also easy to lose during rebuilds and migrations.
Back up at least:
/etc/netdata/(your health overrides and main config)/etc/nginx/sites-available/netdataand/etc/nginx/.htpasswd- Any DNS notes and firewall allowlists
The simplest approach is to roll these into your existing server backups.
If you’re building that process from scratch, use: automated snapshots, offsite copies, and restore tests on Ubuntu.
Common pitfalls (the things that waste the most time)
- Alert fatigue: If you get 30 emails a day, you’ll ignore the one that matters. Start with disk, RAM pressure, and sustained I/O wait.
- Monitoring from the monitored host only: If the server is hard down, you won’t see anything. Pair Netdata with an external uptime check if the site is revenue-critical.
- Unsecured dashboards: A stats UI can reveal paths, ports, and service names. Treat it as sensitive.
- Wrong thresholds for your plan: A 1 vCPU VPS has a different “normal” than an 8-core dedicated server. Tune from baselines, not gut feel.
Summary: a monitoring stack you’ll actually use
This server monitoring setup guide tutorial kept the scope tight: install Netdata, secure access, add TLS, and configure alerts that match hosting realities.
The payoff is speed. You’ll catch disk and I/O problems early. You’ll also stop treating every slowdown like a mystery.
If you’re running production sites and want predictable performance, start with a HostMyCode VPS. If you’d rather have someone else handle patch cadence, service checks, and the “why is this box weird at 2 a.m.” moments, managed VPS hosting is built for that.
Want monitoring you can trust without babysitting a fragile setup? Run Netdata and your sites on a properly sized HostMyCode VPS, or hand the operational overhead to managed VPS hosting so alerts turn into fixes instead of late-night guesswork.
FAQ
Should I install Netdata on the same VPS that hosts my websites?
Yes for small to mid-size servers; Netdata’s overhead is typically modest.
For high-traffic or compliance-heavy environments, consider a separate monitoring host and pull metrics over a private network.
Is it safe to expose Netdata on port 19999 to the internet?
It’s safer not to. Keep it bound to localhost, proxy through Nginx, enable TLS, and restrict access with an allowlist and authentication.
What are the best first alerts for a hosting server?
Disk space on / and /home (or /var), sustained I/O wait, and RAM pressure (swap activity). These three cover a large percentage of real outages.
Why do I see high load average but low CPU usage?
That’s often disk I/O wait or blocked processes. Check Netdata’s disk latency and iowait charts.
On VPS, also check CPU steal for hypervisor contention.
My email alerts don’t arrive. What should I check?
Confirm the server can deliver mail (preferably via an SMTP relay), check DNS records if sending directly, and run the Netdata notifier test script to see the exact failure.