Self-Hosting · Notifications
ntfy: Push Notifications from Your Own Server
ntfy is a small server with a beautifully simple idea: you publish a message by making an HTTP request to a topic, and every phone subscribed to that topic gets a notification. Scripts, backup jobs, appliances, and Home Assistant automations all become notification sources with one curl command each. Self-hosting it is completely free — the paid Pro tier belongs to the hosted service and buys a self-hoster nothing. This guide covers the install, the access control you must set before exposing it, and the one iOS rule that decides whether iPhone notifications arrive instantly or hours late.
Published Nov 21, 2026
The iOS rule, first, because everything else is easy
Read this before you install anything, because it shapes the whole setup. Apple does not allow an app to hold a persistent background connection for push delivery, so the official ntfy app on iOS can only receive instant notifications through Apple’s push service, and the credentials for that path belong to the public ntfy.sh service. A self-hosted server therefore has exactly two choices. The first is to set upstream-base-url to https://ntfy.sh in your server configuration. With that set, when a message arrives your server sends ntfy.sh a small poll request containing only the message ID and a hash of the topic name — not the message text. ntfy.sh relays a wake-up through Apple’s service, and your phone then fetches the actual message content directly from your own server. The content stays between your server and your phone; what passes through the relay is the fact that a message exists, and its timing.
The second choice is to leave the upstream unset, and accept what iOS does without it: delivery falls back to polling, which in practice means delays of twenty to thirty minutes on a phone in active use, and potentially hours on one that is asleep in a drawer. Android has no equivalent problem — against a self-hosted server, the Android app holds its own connection and notifications are instant with no relay involved. So the rule is simple: a household with iPhones sets the upstream and gets instant delivery with message content kept at home; a household without iPhones can skip it entirely. Either way, a self-hosted ntfy that “does not work on my iPhone” is almost always this one setting, not a broken install.
What ntfy is, mechanically
The server is a single small Go program, distributed as one container with a tiny footprint — it runs comfortably in about 128 MB of memory. You choose topic names, which are just URL paths: publishing to your server at the topic backups notifies everyone subscribed to backups. Publishing is an HTTP POST with the message as the body; headers add a title, a priority from silent to urgent, tags that render as emoji in the app, and even file attachments. Subscribing happens in the mobile apps or the web app, and the same topic can feed a phone, a desktop notification, and a script watching the topic’s JSON stream. It speaks plain HTTP in both directions, which is why everything in a homelab can already talk to it: any tool that can run curl, send a webhook, or make a web request is an ntfy client.
That simplicity is the reason ntfy fills a gap other tools leave. Home Assistant has rich notifications of its own through the Companion app — this site’s Companion app guide covers them — but backup jobs, NAS scripts, a 3D printer’s controller, and a monitoring alert are not Home Assistant. ntfy gives all of them one shared, phone-shaped destination that you run yourself. Frigate’s alerting, covered in the Frigate notifications guide, is a good example of a source that can publish to a topic alongside everything else.
Install and the access control you must not skip
The container takes a configuration file (server.yml) and a data directory; the two settings that matter on day one are your base URL — the address phones will use to reach the server — and authentication. A fresh ntfy server is open by default: anyone who can reach it can publish and subscribe. On a home network behind nothing else, that is a convenience. The moment the server is reachable from the internet — which it must be for phones away from home — it is an open relay with your name on it. Set auth-default-access: deny-all, create user accounts, and grant each user access to the topics it needs. Topic names stop being a security mechanism at that point, which is correct: a long random topic name is a password you can never change and everyone shares.
Exposure deserves one decision. The cleanest household pattern is to keep ntfy reachable only through the same route as your other services — a VPN such as Tailscale for the phones, or a reverse proxy with the server’s own authentication in front. Note the interaction with the iOS rule: the upstream relay asks your phone to fetch content from your server, so the phone still needs a working route to it. A VPN on the phone satisfies that; a server that exists only on the LAN with no remote route will deliver the wake-up and then fail the fetch while you are out. Test the full path from mobile data, not from the sofa, before you rely on it for anything that matters.
Putting it to work
Start with three topics and grow only when a topic gets noisy: one for the house (alarm-adjacent events, water leaks, the doorbell class of thing), one for the infrastructure (backup failures, disk warnings, update problems), and one for the merely interesting (a print finished, a package camera event). Priorities do the rest of the sorting: the infrastructure topic can sit at default priority, the house topic at high, and anything that should wake a sleeping human gets the maximum priority and is used sparingly enough to keep its meaning. The pattern that fails is the single firehose topic where a failed backup and a finished print and a sounding alarm arrive dressed identically; within a month the household has muted it, and the server might as well not exist.
Producers are the easy half. A backup script publishes success silently and failure at high priority. Uptime Kuma — covered in this site’s monitoring guide — can notify an ntfy topic natively. Home Assistant can call the HTTP endpoint from any automation, which makes ntfy a second notification channel alongside the Companion app for the automations that must not be missed. Attachments work for small files, so a camera snapshot can ride along with the alert that references it. Everything is a web request; if a tool can make one, it can reach your phone through your own server, and the message content never has to live on anyone else’s computer to get there.
The message features that make it a system, not a buzzer
A plain text alert is the floor, not the ceiling. Priorities run from minimum to maximum and control how insistently the phone presents the message — a minimum-priority message arrives silently for the log, a maximum-priority one sounds and repeats like an alarm, and the middle settings cover everything between. Titles and tags structure the stream: a tag renders as an emoji in the app, which sounds trivial until a lock-screen glance separates the water-leak icon from the backup icon without a word read. Messages can carry a click action that opens a URL when tapped, action buttons that call webhooks — “open the garage” from the notification itself, where that is wise — and a scheduled delivery time, so a reminder can be published now and presented at nine tomorrow. Attachments ride along for small files, and because this is your server, the size limits are your configuration rather than a plan tier.
Two properties matter for anything resembling an alert history. Messages are cached on the server for a configurable window, so a phone that was off or out of coverage receives what it missed when it reconnects, in order. And every topic is also a stream: the same feed that buzzes a phone can be watched by a script, logged to a file, or bridged into another system, because underneath the phone-friendly surface ntfy is just HTTP in both directions. That duality — human notifications and machine-readable events in one tiny service — is why it keeps appearing in other guides in this series as the destination of choice.
Official documentation and references
- ntfy documentation — publishing, subscribing, priorities and attachments
- ntfy server configuration — upstream-base-url, authentication and access control
- ntfy on GitHub — releases for the server and apps
Frequently asked questions
Why are iPhone notifications delayed on my self-hosted ntfy?
iOS does not allow the app to hold a background connection, so instant delivery needs Apple’s push service via the public ntfy.sh relay. Set upstream-base-url to https://ntfy.sh: the relay receives only a message ID and a topic hash, and your phone fetches the message content from your own server. Without it, iOS delivery falls back to polling and can lag by hours.
Does self-hosting ntfy cost anything?
No. Self-hosting is fully free with no feature limits. ntfy Pro is a plan for the hosted ntfy.sh service — reserved topics and higher limits there — and buys nothing on your own server.
Is ntfy secure to expose to the internet?
Only once you configure it: a fresh server allows anyone to publish and subscribe. Set auth-default-access to deny-all, create users, and grant per-topic access before exposing it, or keep it behind a VPN.
How do scripts send a notification?
With a single HTTP POST to the topic URL, the message as the body. Headers set the title, priority and tags. Anything that can run curl or send a webhook — backup jobs, monitoring, Home Assistant — can publish.

