Skip to content

Linux Hardening & Port Sentinel

A lightweight server setup and 24/7 outage alert baseline for small teams running web apps, bots, or APIs on budget Linux VPS instances without full-time ops staff.

Year
2026
Handover
Configs, scripts, and runbook
Release
v1.1
Runs on
Ubuntu / Debian Linux
Interactive Live Demo · Compare Before & After
Step through 1 → 2 → 3 to test the 3-minute port sentinel timeline
HEALTHY BASELINE · 4 NODES / 10 TCP PORTS ONLINE
UFW + ed25519 SSH locked; systemd timer wakes every 3m (0 idle RAM) and stays completely silent while ports pass.
QUIET
Interactive demo above: step sequentially from healthy 4-node operation to a simulated port outage alert at 03:15 and a verified recovery notification on the next 03:18 check.

What it is

This setup turns a fresh Ubuntu or Debian VPS into a hardened, self-healing host: Docker or systemd units restart crashed apps automatically, Nginx serves auto-renewing HTTPS certificates, UFW blocks every unapproved port, and SSH locks down to ed25519 keys only.

For 1 GiB to 2 GiB budget instances where heavy monitoring suites waste scarce RAM, a lightweight systemd oneshot timer wakes every 3 minutes, probes your target TCP ports, and exits cleanly with zero idle memory overhead.

When teams prefer a visual status page on larger instances, we deploy a containerized Uptime Kuma dashboard (~135 MiB RAM) wired to the same webhook channels.

Why we built it

Solo founders and small teams often find out a web service or SSL certificate died only after a customer complains, yet commercial APM suites cost more per month than the VPS itself.

Across 4 live Linux nodes, we standardized a repeatable 4-layer baseline (process recovery, TLS renewal, key-only firewall, and 2 GiB swap buffer) plus state-deduplicated bot alerts so phones only buzz on real DOWN or UP transitions.

What stays on your server

Every credential, service log, and monitoring state file lives exclusively on your own server:

Every 3 minutes
the sentinel performs short TCP handshakes against your configured endpoints and updates a 0600 local state.json file.
On outage or recovery
only the service label, host tag, and UP/DOWN transition timestamp are sent to your own Telegram, Discord, or Feishu webhook.
After handover
all temporary setup access is removed once you verify your own SSH key login and alert notifications.

Journald log caps and 2 GiB swap files prevent disk-full or out-of-memory lockups on small instances.

How it works

Hardened Linux VPS
UFW + SSH key-onlyBlocks brute-force & ports
Nginx TLS + systemdAuto SSL & crash restart
3m oneshot sentinelChecks ports & diffs state
DOWN or UP alertQuiet when healthy
Phone alert botTelegram / Feishu / Slack
Hardened systemd services recover from crashes automatically while the 3-minute timer sends phone alerts only when a monitored port changes state.

Limits

  • Monitoring a server from inside that same single machine catches crashed apps and dead ports, but detecting a total host power-off requires a second probe node or external check.
  • Servers hosted in mainland China require a completed ICP filing before ports 80 and 443 can issue public HTTPS certificates.
  • We configure host security and service daemons on ready-to-run applications; rewriting broken application business logic is scoped separately.

Status

Active in production (v1.1) across 4 Linux VPS instances monitoring 10 live TCP endpoints.