Why Ntfy?
Getting alerts from servers shouldn’t require Slack, PagerDuty, or email. Ntfy makes it dead simple:
- Zero configuration —
curl -d "message" ntfy.sh/topicsends a push notification. - Phone + Desktop — Apps for Android, iOS, and web browser.
- Self-hostable — Run your own instance for privacy and control.
- Integrates with everything — Uptime Kuma, Grafana, cron, shell scripts, CI/CD.
Prerequisites
- Docker (for self-hosted) or use the free public instance at
ntfy.sh. - The Ntfy app on your phone (Android or iOS).
Step 1: Deploy with Docker (Self-Hosted)
docker run -d \
--restart=always \
-p 2586:80 \
-v /var/cache/ntfy:/var/cache/ntfy \
--name ntfy \
binwiederhier/ntfy serve \
--cache-file /var/cache/ntfy/cache.db
Access at http://your-server:2586.
Or just use the free public instance at https://ntfy.sh — no setup required.
Step 2: Send Notifications
Basic Message
curl -d "Deployment to production complete ✅" http://your-server:2586/deployments
With Title, Priority, and Tags
curl \
-H "Title: Backup Failed" \
-H "Priority: urgent" \
-H "Tags: warning,backup" \
-d "MySQL backup on db-server failed at $(date)" \
http://your-server:2586/server-alerts
Priority Levels
| Priority | Effect |
|---|---|
min | No sound, no vibration |
low | No sound |
default | Normal notification |
high | Overrides Do Not Disturb |
urgent | Persistent, loud alert |
Step 3: Common Use Cases
Cron Job Alerts
# /etc/crontab
0 2 * * * root /usr/local/bin/backup.sh && curl -d "✅ Backup done" ntfy.sh/my-server || curl -H "Priority: high" -d "❌ Backup FAILED" ntfy.sh/my-server
CI/CD Pipeline Notifications
# GitHub Actions / Gitea Actions
- name: Notify on success
if: success()
run: curl -d "Build ${{ github.sha }} passed ✅" ntfy.sh/ci-builds
- name: Notify on failure
if: failure()
run: curl -H "Priority: high" -d "Build ${{ github.sha }} FAILED ❌" ntfy.sh/ci-builds
SSH Login Alerts
# /etc/profile.d/ntfy-login.sh
curl -d "SSH login: $(whoami)@$(hostname) from ${SSH_CLIENT%% *}" ntfy.sh/ssh-logins
Troubleshooting
| Problem | Solution |
|---|---|
| Notifications not arriving on phone | Ensure the app is subscribed to the exact topic name; check phone battery optimization settings |
| ”Unauthorized” error | Enable authentication on self-hosted Ntfy; verify credentials |
| Messages delayed | Check if phone is in battery saver mode; verify server connectivity |
| Topic “hijacked” on public instance | Use a long random topic name or self-host for sensitive alerts |
Summary
- Send notifications with a single
curlcommand. - Use priority levels to control urgency (from
mintourgent). - Integrate with cron, CI/CD, Uptime Kuma, Grafana, and any HTTP-capable tool.
- Self-host for control, or use the free ntfy.sh public instance.