TL;DR — Quick Summary
Deploy Healthchecks for self-hosted cron job monitoring with dead man's switch alerting. Docker setup, integrations, and notification channel support included.
What Is Healthchecks?
Healthchecks monitors your cron jobs and scheduled tasks using the dead man’s switch pattern — it alerts you when jobs don’t run, not when they fail with an error.
services:
healthchecks:
image: healthchecks/healthchecks:latest
container_name: healthchecks
restart: always
ports:
- "8000:8000"
environment:
- ALLOWED_HOSTS=*
- DB=postgres
- DB_HOST=db
- DB_NAME=healthchecks
- DB_USER=healthchecks
- DB_PASSWORD=healthchecks
- SECRET_KEY=your-secret-key
- SITE_ROOT=https://hc.yourdomain.com
depends_on:
- db
db:
image: postgres:15-alpine
environment:
POSTGRES_DB: healthchecks
POSTGRES_USER: healthchecks
POSTGRES_PASSWORD: healthchecks
volumes:
- hc-data:/var/lib/postgresql/data
volumes:
hc-data:
How It Works
Your Cron Job → completes → pings URL → ✅ Healthchecks records success
Your Cron Job → fails/hangs → no ping → ⏰ Grace period → 🚨 Alert sent
Usage Examples
# Add to end of any cron job
0 * * * * /usr/bin/backup.sh && curl -fsS https://hc.yourdomain.com/ping/UUID
# Report success/failure separately
/usr/bin/backup.sh && curl https://hc.../ping/UUID || curl https://hc.../ping/UUID/fail
# Measure execution time (start + finish)
curl https://hc.../ping/UUID/start && /usr/bin/backup.sh && curl https://hc.../ping/UUID
Healthchecks vs Alternatives
| Feature | Healthchecks | Uptime Kuma | Cronitor |
|---|---|---|---|
| Pattern | Dead man’s switch | Active polling | Both |
| Self-hosted | ✅ | ✅ | ❌ |
| Cron monitoring | ✅ Native | ❌ | ✅ |
| HTTP monitoring | ❌ | ✅ Native | ✅ |
| Cost | Free | Free | $20+/mo |