Technology Encyclopedia Home >Deploy Netdata for Real-Time Server Monitoring — See Everything Happening on Your VPS in Seconds

Deploy Netdata for Real-Time Server Monitoring — See Everything Happening on Your VPS in Seconds

When something is wrong with a server, the first question is always "what's using all the CPU?" or "why is disk I/O so high?" Netdata answers these questions in real time with per-second metrics, a beautiful dashboard, and zero configuration overhead.

Unlike Prometheus + Grafana (which is powerful but takes hours to configure), Netdata works in 5 minutes. Install it, open the dashboard, and you immediately see CPU usage by core, memory breakdown, disk I/O per device, network traffic by interface, running processes with their resource usage, and metrics for any services like Nginx, PostgreSQL, or Docker that are already running.

I run Netdata on every Tencent Cloud Lighthouse instance I manage. The agent uses only about 1–2% CPU and 50–100 MB RAM — negligible overhead. Lighthouse includes basic monitoring metrics in the control panel (CPU and bandwidth graphs), but Netdata provides per-second granularity, per-process visibility, and service-level metrics (Nginx requests, PostgreSQL connections, Docker container usage) that the control panel doesn't show. The two systems complement each other: Lighthouse's console for infrastructure-level visibility, Netdata for application-level detail.


Table of Contents

  1. Why Netdata?
  2. What You Need
  3. Part 1: Install Netdata
  4. Part 2: Access the Dashboard
  5. Part 3: Secure Access with Nginx and Basic Auth
  6. Part 4: Configure Alerts
  7. Part 5: Monitor Specific Services
  8. Part 6: Netdata Cloud (Optional)
  9. The Thing That Tripped Me Up
  10. Troubleshooting
  11. Summary

  • Key Takeaways
  • Use the appropriate Lighthouse application image to skip manual installation steps where available
  • Lighthouse snapshots provide one-click full-server backup before major changes
  • OrcaTerm browser terminal lets you manage the server from any device
  • CBS cloud disk expansion handles growing storage needs without server migration
  • Console-level firewall + UFW = two independent protection layers

Why Netdata? {#why}

Netdata fills a specific niche — lightweight, zero-config, real-time monitoring:

Feature Netdata Prometheus + Grafana
Setup time 5 minutes 2–4 hours
Real-time data Per-second 15-second scrapes (default)
Auto-discovery Yes (detects services) Manual configuration
Memory usage ~50–100 MB ~300 MB+
Historical data 1-3 days (local) Unlimited (with Prometheus)
Alerting Built-in Requires AlertManager
Learning curve Near zero Significant

For day-to-day operational visibility on a personal or small-team server, Netdata is the right tool. For long-term trend analysis and complex dashboards, Prometheus + Grafana is more powerful.


What You Need {#prerequisites}

Requirement Details
Server Any Linux, 512 MB+ RAM
OS Ubuntu 22.04 (works on any Linux)
Domain Optional — for remote HTTPS access

Part 1: Install Netdata {#part-1}

1.1 — One-Line Install

bash <(curl -Ss https://my-netdata.io/kickstart.sh) --stable-channel

This installs Netdata, enables the systemd service, and starts it immediately. The installation takes about 2 minutes.

What it installs:

  • The Netdata daemon
  • All built-in collector plugins
  • systemd service configured to start on boot

1.2 — Verify It's Running

sudo systemctl status netdata

Netdata listens on port 19999 by default:

curl http://localhost:19999/api/v1/info | python3 -m json.tool

Part 2: Access the Dashboard {#part-2}

2.1 — Access via SSH Tunnel

Netdata's dashboard is accessible locally. For immediate access via SSH tunnel:

ssh -L 19999:localhost:19999 ubuntu@YOUR_SERVER_IP

Open http://localhost:19999 in your browser. The Netdata dashboard loads instantly.

2.2 — Explore the Dashboard

The main sections:

Section What You See
System Overview CPU, RAM, disk I/O, network summary
CPU Per-core usage, context switches, interrupts
Memory RAM breakdown (used/cached/free), swap
Disks I/O per disk, read/write speeds, utilization
Network Traffic per interface, packets, errors
Processes Top processes by CPU, memory, I/O
Apps Resource usage grouped by application type
Nginx Request rate, connections, response codes
PostgreSQL Queries, connections, checkpoints
Docker Per-container CPU, memory, network

All data updates every second. Use the playback controls at the bottom to scrub through recent history.


Part 3: Secure Access with Nginx and Basic Auth {#part-3}

3.1 — Install Nginx and Certbot

sudo apt install -y nginx certbot python3-certbot-nginx apache2-utils

3.2 — Create Password File

sudo htpasswd -c /etc/nginx/.htpasswd admin
# Enter and confirm a password

3.3 — Create Nginx Site

sudo nano /etc/nginx/sites-available/netdata
server {
    listen 80;
    server_name monitor.yourdomain.com;

    auth_basic "Netdata Monitoring";
    auth_basic_user_file /etc/nginx/.htpasswd;

    location / {
        proxy_pass http://localhost:19999;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        
        # WebSocket support for live updates
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}
sudo ln -s /etc/nginx/sites-available/netdata /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
sudo certbot --nginx -d monitor.yourdomain.com

Access the dashboard at https://monitor.yourdomain.com.

3.4 — Restrict Netdata to Localhost Only

Since Nginx handles external access, configure Netdata to only listen locally:

sudo nano /etc/netdata/netdata.conf
[web]
    bind to = 127.0.0.1
sudo systemctl restart netdata

Part 4: Configure Alerts {#part-4}

Netdata includes built-in alert rules for common thresholds. To customize:

4.1 — View Current Alerts

In the dashboard, click the bell icon (top right) to see active alerts.

4.2 — Configure Email Alerts

sudo nano /etc/netdata/health_alarm_notify.conf
SEND_EMAIL="YES"
DEFAULT_RECIPIENT_EMAIL="you@example.com"

# SMTP settings
SMTP_SERVER="smtp.sendgrid.net"
SMTP_PORT="587"
SMTP_TLS="starttls"
SMTP_USERNAME="apikey"
SMTP_PASSWORD="your-sendgrid-api-key"
SMTP_FROM="netdata@yourdomain.com"

Test the alert system:

sudo -u netdata /usr/libexec/netdata/plugins.d/alarm-notify.sh test

4.3 — Configure Slack/Telegram Alerts

For Slack:

SEND_SLACK="YES"
SLACK_WEBHOOK_URL="https://hooks.slack.com/services/YOUR/WEBHOOK/URL"
DEFAULT_RECIPIENT_SLACK="monitoring"

For Telegram:

SEND_TELEGRAM="YES"
TELEGRAM_BOT_TOKEN="your-telegram-bot-token"
DEFAULT_RECIPIENT_TELEGRAM="your-chat-id"

4.4 — Custom Alert Thresholds

Example: alert when disk is 90% full (default is 85%):

sudo nano /etc/netdata/health.d/disk.conf
warn: $this > 90
crit: $this > 95
sudo systemctl restart netdata

Part 5: Monitor Specific Services {#part-5}

Netdata auto-discovers services running on your server. Here's what to expect:

Nginx

If Nginx is running and the status page is enabled, Netdata shows request rate, active connections, and response codes automatically.

Enable Nginx status page:

# Add to your Nginx server block
location /nginx_status {
    stub_status;
    allow 127.0.0.1;
    deny all;
}

PostgreSQL

Netdata connects to PostgreSQL via the stats views. Create a monitoring user:

CREATE USER netdata WITH PASSWORD 'netdata';
GRANT CONNECT ON DATABASE postgres TO netdata;
GRANT USAGE ON SCHEMA pg_catalog TO netdata;
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA pg_catalog TO netdata;
GRANT SELECT ON ALL TABLES IN SCHEMA pg_catalog TO netdata;

Docker

Netdata auto-discovers Docker containers and shows per-container metrics. No configuration needed if Docker is installed.

Custom Application Metrics

Expose custom metrics via Netdata's StatsD integration:

import socket

def send_metric(metric_name, value):
    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    message = f"{metric_name}:{value}|g"
    sock.sendto(message.encode(), ('127.0.0.1', 8125))

# Usage
send_metric('myapp.orders_per_minute', 42)
send_metric('myapp.response_time_ms', 125)

Part 6: Netdata Cloud (Optional) {#part-6}

Netdata offers a free cloud tier that aggregates metrics from multiple servers into one dashboard, with longer retention and cross-server alerting.

Connect to Netdata Cloud

  1. Create a free account at app.netdata.cloud
  2. In the Cloud dashboard, click Connect Nodes → Add Node
  3. Copy the connection command (a netdata-claim.sh call)
  4. Run it on your server

Once connected, your server's metrics appear in the Netdata Cloud dashboard. You can view multiple servers side by side and set up cross-server alerts.

The free tier includes up to 5 nodes and 14-day retention — sufficient for personal use.


The Thing That Tripped Me Up {#gotcha}

After running Netdata for a few days, disk usage on /var/cache/netdata started growing unexpectedly. After a week, it had accumulated about 2 GB.

Netdata stores time-series data in its own database format. By default, it retains data for about 3 days using memory-mapped files. The cache directory was filling up because I hadn't adjusted the retention settings.

The fix: Configure data retention explicitly:

sudo nano /etc/netdata/netdata.conf
[global]
    # How much memory for metrics (in MB)
    # Each 256 MB = ~3 days of per-second data
    memory mode = ram
    history = 3600  # Seconds of data to keep in RAM

[db]
    # Or use file storage with explicit size limit
    mode = dbengine
    # Disk space limit for the database (in MB)
    dbengine multihost disk space MB = 500
sudo systemctl restart netdata

With dbengine mode and a 500 MB limit, Netdata automatically manages storage within that budget. For 500 MB, you get about 2–3 days of per-second metrics for a typical server.


Troubleshooting {#troubleshooting}

Issue Likely Cause Fix
Dashboard shows nothing Netdata not running sudo systemctl start netdata
Services not showing Auto-detection failed Check collector logs: journalctl -u netdata -f
High disk usage Unlimited retention Configure dbengine multihost disk space MB
Alert emails not sending SMTP config error Test with alarm-notify.sh test
Dashboard slow to load Too many charts Reduce chart count in netdata.conf
Can't access via Nginx Port not proxied Check Nginx proxy_pass points to localhost:19999
WebSocket connection failing Missing Nginx headers Add Upgrade and Connection headers to Nginx config

Summary {#verdict}

What you built:

  • Real-time server monitoring with per-second metrics
  • Beautiful, auto-configured dashboard with no manual setup
  • HTTPS access via Nginx with Basic Auth
  • Alerts for CPU, memory, disk, and service health
  • Auto-discovered monitoring of Nginx, PostgreSQL, Docker
  • Custom application metrics via StatsD

Netdata is the fastest way to go from "something is wrong" to "I know exactly what's wrong." Install it on every server you manage.

Frequently Asked Questions {#faq}

How much resource does Netdata use on the server?
Netdata is designed to be lightweight. It typically uses minimal CPU and 50–200 MB RAM. Run it on the same server as your applications without significant impact.

How do I get alerts when a service goes down?
Configure Netdata's notification integrations — most support email, Telegram, Slack, Discord, and webhook. Set appropriate check intervals (every 60 seconds is typical) and recovery thresholds to avoid alert fatigue from brief glitches.

Can I monitor multiple servers with one Netdata instance?
Yes. Add the server IPs or domains as separate monitors. For agent-based monitoring, install the agent on each server you want to track.

How do I monitor SSL certificate expiry?
Add a certificate check to your monitoring. Most monitoring tools including Netdata support HTTPS checks that alert when certificates are within a configurable days-to-expiry threshold.

What's the difference between uptime monitoring and performance monitoring?
Uptime monitoring checks if a service is available (up/down). Performance monitoring tracks metrics over time (CPU%, response times, database query counts). Both are complementary.

👉 Get started with Tencent Cloud Lighthouse
👉 View current pricing and launch promotions
👉 Explore all active deals and offers