Practical systemd health checks for personal services

Mar 2026 · Linux ·

For small servers, a few systemd timers and clear logs are often enough. The point is not to replace monitoring systems, but to catch common failures quickly and keep recovery commands obvious.

Timer pattern

A health check can be a short script that tests a local port, validates a response body, and exits non-zero on failure. The timer runs it every few minutes and writes to the journal.

[Timer]
OnBootSec=2min
OnUnitActiveSec=5min
Unit=site-health.service

Keep the signal small

The best alert is one you can act on immediately. Include the failed URL, status code, and last deploy identifier. Avoid dumping full pages into the log.