Video tutorial coming soon.
🔔 Setup ntfy — Self-Hosted Push Notifications
Deploy ntfy on Ubuntu with Docker — a beautifully simple HTTP-based pub/sub notification service. Send push notifications to your phone or desktop from any script, cron job, or application with a single HTTP request.
📦 Resources & Setup Scripts
Grab the automated bash script from GitHub to follow along with the video.
Quick Install:
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/communication/ntfy/ntfy-ubuntu.sh
chmod +x ntfy-ubuntu.sh
sudo bash ntfy-ubuntu.sh
Tutorial Steps
1 Download & Run the Script
The script installs Docker and starts the ntfy server with persistent storage for message history.
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/communication/ntfy/ntfy-ubuntu.sh
chmod +x ntfy-ubuntu.sh
sudo bash ntfy-ubuntu.sh
2 Send Your First Notification
Send a test notification with a simple curl command. Topics are created on-the-fly — no signup required:
curl -d "Backup finished successfully!" http://<your-server-ip>:8095/alerts
3 Subscribe from Your Phone
Install the ntfy app on Android or iOS. Tap "Add subscription" → "Use another server" → enter your server URL and the topic name (e.g. "alerts"). You'll receive push notifications instantly whenever something publishes to that topic.
4 Integrate with Scripts & Cron Jobs
Add ntfy notifications to any shell script or cron job. You can set priority, tags, and titles using HTTP headers for richer notifications:
curl -H "Title: Server Alert" \
-H "Priority: urgent" \
-H "Tags: warning,computer" \
-d "Disk usage exceeded 90%!" \
http://<your-server-ip>:8095/alerts
Ports Used
| Port | Purpose |
|---|---|
| 8095 | ntfy Web UI & API |
Overview
ntfy (pronounced 'notify') is a simple, open-source HTTP-based pub/sub notification service. Any script, application, or service can send a push notification to any subscribed device by making a single HTTP POST request. No app registration, no API keys for publishers — just send to a topic URL and all subscribers receive it instantly.
Why Use It
ntfy solves the last-mile problem for server automation: getting a real push notification to your phone from any script, cron job, monitoring alert, or pipeline — with a single HTTP POST and zero app registration. Unlike Slack webhooks or email alerts, ntfy delivers instantly to native mobile push notifications and works from any environment that can make an HTTP request, including bash, Python, curl, and any language. Self-hosting means your alert data never touches a third-party server.
When You Need It
Who Should Use It
Real Use Cases
Main Features
How to Use After Installation
Security Best Practices
Ports and Firewall Notes
ntfy runs on port 80 (HTTP) and optionally 443 (HTTPS) by default. Put it behind Nginx Proxy Manager on HTTPS port 443 — all publishers and subscribers should use HTTPS so message content is encrypted in transit. The Android/iOS apps and web UI all connect to your configured server URL. No inbound ports beyond 443 are required. If you use Firebase for Android push delivery, outbound access to Google FCM servers is needed; the F-Droid app version avoids this entirely.
Backup and Maintenance
Common Mistakes
Troubleshooting
Alternatives
Gotify is the most common alternative — simpler, single-binary, but requires the proprietary Gotify app (no official iOS app). Pushover is a paid cloud service ($5 one-time) with excellent iOS/Android support but your notifications pass through their servers. Apprise is a Python library (not a server) that sends to 50+ notification channels simultaneously — useful for multi-target alerting. Telegram bots are popular for self-hosted alerts and work globally without infrastructure but require a Telegram account.
When Not to Use It
Avoid ntfy if you need guaranteed message delivery with acknowledgement and retry logic — ntfy is fire-and-forget; if the subscriber is offline, messages may be lost depending on your cache configuration. Don't use it as a full chat or team messaging replacement — use Mattermost for that. If your organization is already on Slack or Teams with good webhook support, adding ntfy just creates another system to maintain. For regulated environments where notification content is sensitive, ensure your ntfy instance is properly secured before routing alerts through it.
Need Help Setting Up ntfy?
PrismaTechWork provides end-to-end infrastructure services — from initial deployment and security hardening to ongoing monitoring, automated backups, and dedicated support. Whether you need a single-server setup or a multi-site network, our team ensures your infrastructure is built right, secured properly, and maintained reliably.
Frequently Asked Questions
Do I need a Google account or Firebase to use ntfy on Android?
No. The ntfy app on F-Droid uses a direct WebSocket connection to your server — no Firebase, no Google services, no Google account required. The Play Store version uses Firebase for push delivery (for battery efficiency), but you can disable it per-subscription. For full privacy and Google independence, use the F-Droid version with a self-hosted ntfy server.
How do I send a notification from a bash script?
One line: `curl -d 'Backup completed' https://ntfy.yourdomain.com/mytopic`. With authentication: `curl -u username:password -d 'Backup completed' https://ntfy.yourdomain.com/mytopic`. With title and priority: `curl -H 'Title: Backup Done' -H 'Priority: high' -d 'All files backed up successfully' https://ntfy.yourdomain.com/mytopic`. No SDK or library needed.
Can multiple people subscribe to the same topic?
Yes. Any number of devices or people can subscribe to the same topic — they all receive every message published to it. This makes ntfy useful for team-wide alerts where everyone on call needs the same notification. Create separate topics for different alert types or audiences (e.g., ops-alerts, personal-scripts, backup-status) to avoid notification overload.
Can I send notifications from ntfy to Slack or email as well?
ntfy itself just delivers to subscribed ntfy clients. But many monitoring tools that support ntfy also support other channels simultaneously — configure both in Uptime Kuma or Grafana. Alternatively, run a script that subscribes to your ntfy topic and forwards messages to Slack/email. ntfy's /v1/json stream endpoint makes it easy to consume messages programmatically and re-publish them anywhere.
How long does ntfy keep message history?
By default, ntfy keeps messages in memory (lost on restart). To persist history, set cache-file in server.yml to a SQLite path and configure cache-duration (e.g., 24h). Subscribers who reconnect after a period can fetch missed messages up to the cache duration. Without a cache file, subscribers only see messages sent after they connect.
Is there a rate limit on how many notifications I can send?
On a self-hosted ntfy instance, you control the rate limits via visitor-request-limit-* settings in server.yml. By default, there are generous limits to prevent abuse on public instances. On your own private server with authentication, you can effectively remove limits for trusted users. ntfy.sh (the public cloud instance) has strict rate limits — another reason to self-host.
How do I integrate ntfy with Uptime Kuma?
In Uptime Kuma, go to Settings > Notifications > Add Notification > select ntfy. Enter your ntfy server URL, topic name, and priority. If using authentication, enter your username and password or token. Test the notification to verify delivery. Then assign this notification channel to each monitor you want to alert. Uptime Kuma sends a ntfy notification whenever a monitor goes down or recovers.
Can I use ntfy without a domain — just an IP address?
Yes, ntfy works with an IP address. However, HTTPS over plain IP requires a self-signed certificate, which the ntfy app may reject or show a warning for. The easiest approach is to use a free domain (DuckDNS, nip.io) with Let's Encrypt to get a valid HTTPS certificate, or to access ntfy only on your local network where you control certificate trust. For public internet use, a domain with a valid certificate is strongly recommended.
