← All templates · Analytics and monitoring
Deploy ntfy in one click
Push notifications to your phone and desktop from scripts, over HTTP
A self-hosted alternative to Pushover and Pushbullet.
What is ntfy?
ntfy is an open-source push notification service that people run instead of Pushover. A script, cron job or CI step sends one HTTP request to a topic, and every phone and browser subscribed to it shows the message. A notification can carry a priority from min to urgent, emoji tags, an attachment and up to three action buttons. Apps for Android, iOS and the browser receive them, and Uptime Kuma, Home Assistant and Healthchecks.io are among ntfy's official integrations.
People self-host it for privacy. The public ntfy.sh also publishes every message to Google's Firebase Cloud Messaging, and its free use has limits; on a server of your own, messages go nowhere else and you set the limits. The catch is the iPhone: iOS restricts background work, so instant delivery from a private server needs a relay through ntfy.sh, which receives only a message ID and a topic hash. Without it, notifications can arrive hours late.
Hosting ntfy on Pethost
- You sign in to Pethost with a passkey, GitHub or Google. No machine yet? You pick a plan, and the link waits until it is ready.
- New project opens at ntfy. You fill in what it asks for and click Create project: Admin password.
- In a minute or two ntfy is live at its own address with HTTPS. Its secrets are made at random, and its data is in the nightly backup.
- It is a project like any other: you or your agent can change it, roll it back or restore it.
Questions about ntfy
Is ntfy free and open source?
Yes. ntfy is dual-licensed under Apache 2.0 and GPLv2, and its server, web app and Android and iOS apps are open source. The public server at ntfy.sh is free without sign-up, with paid plans for higher limits.
ntfy vs Pushover: what is the difference?
ntfy is open source and its server can run on your own machine. It also needs no account: on ntfy.sh, anyone who knows a topic's name can publish or subscribe, so the name works like a password.
How do I send a notification to ntfy with curl?
POST or PUT the message to the topic's URL: curl -d "Backup done" https://ntfy.example.com/backups. Title, Priority and Tags go in headers, and a server with access control takes -u user:password or an access token.
Does ntfy support UnifiedPush?
Yes. The ntfy Android app can act as a UnifiedPush distributor, so apps such as Element, Tusky and Fedilab receive their push messages through your ntfy server rather than Google's Firebase Cloud Messaging.
How do I make a self-hosted ntfy server private?
Set auth-default-access to deny-all, create users with ntfy user add, and grant each one topics with ntfy access, for example ntfy access phil alerts rw. The Pethost template starts this way, with an admin user.
How much memory and disk does ntfy need?
ntfy is very light: tens of megabytes of memory, and its message cache stays small. On Pethost the Starter plan is enough for it, with room for other apps beside it.
ntfy Docker Compose file
The template is this compose.yaml and the variables written into the project’s .env as it is created. Pethost runs the file as it is written.
Containers: ntfy (binwiederhier/ntfy:v2.30.0).
Volumes, in the nightly backup: data.
services:
ntfy:
image: binwiederhier/ntfy:v2.30.0
restart: unless-stopped
environment:
NTFY_BASE_URL: ${URL}
NTFY_LISTEN_HTTP: ":80"
NTFY_BEHIND_PROXY: "true"
NTFY_CACHE_FILE: /var/lib/ntfy/cache.db
NTFY_AUTH_FILE: /var/lib/ntfy/user.db
# Without a user nobody reads or sends: the address alone does not open a topic.
NTFY_AUTH_DEFAULT_ACCESS: deny-all
NTFY_ENABLE_LOGIN: "true"
NTFY_REQUIRE_LOGIN: "true"
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
# ntfy makes its user database at the first start, and only then takes a user: it is started
# once on a port nobody reaches, the admin is added, and the server proper starts.
entrypoint:
- sh
- -c
- |
set -e
if [ ! -f /var/lib/ntfy/user.db ]; then
ntfy serve --listen-http 127.0.0.1:81 &
until wget -q -O /dev/null http://127.0.0.1:81/v1/health; do sleep 1; done
kill $$!
wait $$! || true
NTFY_PASSWORD="$$ADMIN_PASSWORD" ntfy user add --role=admin admin
fi
exec ntfy serve
volumes:
- data:/var/lib/ntfy
volumes:
data:
More in Analytics and monitoring
- UmamiWeb analytics for your sites, without cookies
- Uptime KumaUptime monitoring with alerts and status pages
- KenerA status page with uptime monitors and incidents
- BeszelLightweight server monitoring: CPU, memory, disk, network and Docker stats, with history and alerts
- changedetection.ioWatches web pages and tells you when they change: prices, restocks, news
- CheckmateUptime, page speed and infrastructure monitoring, with status pages