DevOps13 min read•Updated November 2026

How to Set Up Monitoring and Logging for Applications on a VPS

Quick answer

Start with three layers: (1) an external uptime check that hits your site's health endpoint and alerts you when it fails; (2) host metrics (CPU, RAM, disk, network) from an agent such as Prometheus node_exporter or Netdata, with alerts on disk space and memory; (3) logs kept in journald with sensible size limits and rotated files, shipped to a central store once you have several servers. Alert on symptoms users feel (site down, errors, slow responses) and on a few early warnings (disk filling, memory exhausted).

Most outages on a single server are boringly predictable: the disk fills up with logs, memory runs out, a certificate expires, or a process dies and nothing restarts it. Monitoring is how you find out before your customers do. You do not need an enterprise observability platform for a VPS, but you do need a few deliberate pieces and alerts that reach you.

What to Monitor

LayerExamplesWhy
AvailabilityHTTP status and response time from outsideThe only check that matches what users see
Host resourcesCPU, load, RAM, swap activity, disk usage and I/O, networkEarly warning of capacity problems
ServicesIs Nginx, the app, the database running? Restart countsDetect crashes and restart loops
ApplicationError rate, request latency, queue lengthProblems that do not take the site fully down
Expiry datesTLS certificates, domainsAvoidable, embarrassing outages

Step 1: Add a Health Endpoint

Give your application a /health (or /healthz) endpoint that returns 200 only when the app can actually serve requests, for example after checking it can reach the database. Keep it cheap and unauthenticated, return no sensitive details, and use it for both uptime checks and deploy health gates.

Step 2: External Uptime Checks

Monitoring has to run somewhere other than the server it watches, otherwise it goes down with it. Options:

  • A hosted uptime service with a free tier.
  • Uptime Kuma, a self-hosted dashboard, running on a different small server. It supports HTTP, keyword, TCP, ping and DNS checks, certificate-expiry warnings and many notification channels (email, Telegram, Discord, Slack, webhooks).
docker run -d --restart=unless-stopped -p 127.0.0.1:3001:3001 \
  -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1

Put it behind Nginx with HTTPS and a login, and check every 1–5 minutes. Uptime Kuma's "push" monitors are also useful for cron jobs: the job calls a URL when it succeeds, and you are alerted if the call stops arriving.

Step 3: Host Metrics

Quick option: Netdata

Netdata installs an agent that collects thousands of metrics per second with a built-in dashboard and default alerts, with almost no configuration. It is ideal when you want visibility on one or two servers quickly. Keep its dashboard port closed to the internet and access it through an SSH tunnel or an authenticated proxy.

Standard option: Prometheus, node_exporter and Grafana

For several servers, the widely used open-source stack is:

  • node_exporter on each server, exposing host metrics on port 9100.
  • Prometheus scraping those exporters and evaluating alert rules.
  • Alertmanager sending notifications.
  • Grafana for dashboards.
sudo apt install -y prometheus-node-exporter
curl -s http://127.0.0.1:9100/metrics | head

Only let your Prometheus server reach port 9100 (a UFW rule for its IP, or a private network). Example alert rules that catch the most common VPS problems:

groups:
- name: host
  rules:
  - alert: DiskAlmostFull
    expr: (node_filesystem_avail_bytes{fstype!~"tmpfs|overlay"} / node_filesystem_size_bytes{fstype!~"tmpfs|overlay"}) < 0.10
    for: 10m
    labels: {severity: warning}
    annotations: {summary: "Less than 10% disk free on {{ $labels.instance }} {{ $labels.mountpoint }}"}
  - alert: LowMemory
    expr: node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes < 0.10
    for: 10m
    labels: {severity: warning}
  - alert: HostDown
    expr: up{job="node"} == 0
    for: 2m
    labels: {severity: critical}

The for: clause avoids alerts on brief spikes. Prometheus and Grafana together use a few hundred MB to a few GB of RAM depending on retention, so many people run them on a separate small VPS that also hosts Uptime Kuma.

Step 4: Logs on the Server

systemd's journal collects output from every service you run under systemd. Useful commands:

journalctl -u app --since "1 hour ago"
journalctl -u app -p err -b          # errors since boot
journalctl -f                         # follow everything
journalctl --disk-usage

Cap the journal so it can never fill the disk, in /etc/systemd/journald.conf:

[Journal]
SystemMaxUse=1G
MaxRetentionSec=1month
sudo systemctl restart systemd-journald

Applications that write their own log files need logrotate. Example /etc/logrotate.d/myapp:

/var/log/myapp/*.log {
    daily
    rotate 14
    compress
    delaycompress
    missingok
    notifempty
    copytruncate
}

copytruncate works with apps that keep the file open; if your app can reopen logs on a signal, use a postrotate script instead, which does not risk losing lines. Docker containers need their own log limits; see our Docker guide.

Step 5: Centralise Logs When You Have Several Servers

Searching logs server by server stops scaling quickly. Common open-source options:

  • Grafana Loki with an agent (Grafana Alloy, the successor to Promtail) on each server: indexes labels rather than full text, so it is light on resources and integrates with Grafana dashboards.
  • Elasticsearch/OpenSearch with Kibana/OpenSearch Dashboards: powerful full-text search, but memory-hungry; plan several GB of RAM for it.

Whatever you choose, ship logs over an encrypted connection and keep the log server's ports private.

Step 6: Application Metrics

Host metrics tell you the server is healthy; application metrics tell you users are. At minimum track request rate, error rate (HTTP 5xx) and latency (p95), plus queue length if you use background jobs. Most frameworks have a Prometheus client library or exporter. Nginx's access log already contains status codes and, with $request_time added to the log format, response times you can analyse.

Error trackers such as Sentry (hosted or self-hosted) capture exceptions with stack traces and are often the fastest way to find bugs after a deploy.

Step 7: Alert Well

  • Alert on symptoms first: site down, error rate high, latency high. These always matter.
  • Add a few causes as warnings: disk above 90%, memory exhausted, certificate expiring within 14 days, backups not run.
  • Every alert should need an action. Alerts you learn to ignore are worse than none.
  • Use a channel you actually see, such as a phone notification for critical alerts, and email for warnings.
  • Test alerts by stopping a service or filling a test disk, so you know the notification path works.

SkyRainCloud Plans for This Workload

Lightweight monitoring (uptime checks, an exporter, journald) runs on any plan. A full Prometheus, Grafana and Loki stack needs a few GB of RAM of its own, so either give it its own small VPS or choose a plan with spare memory.

Intel Xeon Platinum 8269CY VPS

KVM VPS on Intel Xeon Platinum 8269CY (up to 3.80 GHz Turbo) with DDR4 ECC memory, NVMe SSD, full root access and an unmetered 1 Gbps port.

PlanvCoresRAMStorageNetworkPriceGood forBuy
VPS 1 — Intel28 GB DDR4 ECC40 GB NVMe SSD1 Gbps, unmetered₹649/monthBusiness websites, small apps, scheduled jobs and botsOrder
VPS 2 — Intel416 GB DDR4 ECC80 GB NVMe SSD1 Gbps, unmetered₹1,169/monthBusiness software, mid-size databases, several sites on one serverCheck stock
VPS 3 — Intel832 GB DDR4 ECC150 GB NVMe SSD1 Gbps, unmetered₹2,249/monthERP/CRM stacks, heavier databases, multiple production appsCheck stock
VPS 4 — Intel1664 GB DDR4 ECC250 GB NVMe SSD1 Gbps, unmetered₹4,299/monthHigh-memory workloads and consolidated production serversCheck stock

AMD EPYC 7C13 VPS

Dedicated KVM vCores on AMD EPYC 7C13 (up to 3.70 GHz) with DDR4 ECC memory, NVMe SSD and an unmetered 1 Gbps port.

PlanvCoresRAMStorageNetworkPriceGood forBuy
VPS 1 — AMD28 GB DDR4 ECC40 GB NVMe SSD1 Gbps, unmetered₹649/monthWebsites, small APIs, bots, staging and VPN serversOrder
VPS 2 — AMD416 GB DDR4 ECC80 GB NVMe SSD1 Gbps, unmetered₹1,299/monthWooCommerce, Node.js/Python backends, Docker Compose stacks, CI runnersOrder
VPS 3 — AMD832 GB DDR4 ECC150 GB NVMe SSD1 Gbps, unmetered₹2,499/monthProduction databases, high-traffic sites, multi-container appsOrder
VPS 4 — AMD1664 GB DDR4 ECC250 GB NVMe SSD1 Gbps, unmetered₹4,899/monthLarge production workloads, SaaS platforms, analytics, in-memory cachesOrder

Prices are monthly in INR as listed on the SkyRainCloud store (verified 2026-11-14). Stock and final pricing are shown on the product page at checkout.

A Minimum Setup for a Single VPS

  1. A /health endpoint and an external uptime check with phone alerts.
  2. Certificate-expiry monitoring (Uptime Kuma or your uptime service does this).
  3. Netdata or node_exporter with alerts on disk, memory and service restarts.
  4. journald capped at a fixed size; logrotate for app log files.
  5. A push monitor on your backup job so a silent failure triggers an alert.

Frequently Asked Questions

What is the simplest way to monitor a VPS?
An external uptime check on a health endpoint, plus an agent such as Netdata for CPU, memory and disk with default alerts. That covers most outages on a single server.
Should the monitoring tool run on the same server?
The uptime check should not, because it cannot alert you when that server is down. Metrics agents run on the server; the alerting system and dashboards are best on a separate small instance.
How do I stop logs from filling up my disk?
Cap journald with SystemMaxUse, rotate app log files with logrotate, and set log size limits for Docker containers.
Prometheus or Netdata?
Netdata is the fastest way to get detailed metrics and alerts on a few servers. Prometheus with Grafana is the standard for many servers, custom application metrics and long-term retention.
What should I alert on?
User-facing symptoms (site down, high error rate, slow responses) and a few early warnings: disk nearly full, memory exhausted, certificates expiring, backups missing.
How do I monitor cron jobs?
Use a push or heartbeat monitor: the job calls a URL on success, and you get an alert if the call does not arrive on schedule.
Is Promtail still recommended for Loki?
Grafana now recommends Grafana Alloy as the collector for new setups. Existing Promtail deployments keep working, but new installations should use Alloy.
How much RAM does a monitoring stack need?
An exporter or Netdata agent needs little. Prometheus, Grafana and Loki together typically need from several hundred MB to a few GB depending on retention and the number of servers.
How do I view logs for a systemd service?
Run journalctl -u servicename; add -f to follow, --since to filter by time and -p err to show only errors.
Which SkyRainCloud plan suits a monitoring server?
A dedicated monitoring server for a handful of hosts usually fits the 2 vCore / 8 GB plan. Large Prometheus or Elasticsearch deployments with long retention need the 16 GB tier or more.
Instant UPI • ₹649/mo
Fast KVM Cloud Provisioning