Phone alerts with ntfy

Updated 11 October 2026 · 4 min read · By Anders Karlsson

ntfy is a free, open-source service that sends push notifications to your phone. You send a message with a single HTTP request, and it appears in the app on your phone within a second or so. That makes ntfy a simple way to get alerts from backups, monitoring and honeypots, without building your own app or paying for text messages.

Get started in two minutes

  1. Install the ntfy app from the App Store or Google Play.
  2. Subscribe to a topic. Choose a long name that nobody can guess, for example alerts-vejby-k9x2m7q4w8.
  3. Send a test message from a computer:
curl -d "Test alert from the office" ntfy.sh/alerts-vejby-k9x2m7q4w8

The message appears in the app straight away. If it works, you have an alert system.

Title, priority and icons

With HTTP headers you can give the message a title, a priority and tags that are shown as icons:

curl -H "Title: Intrusion attempt" \
     -H "Priority: urgent" \
     -H "Tags: rotating_light" \
     -d "192.168.1.47 tried to log in to NAS-FINANCE" \
     ntfy.sh/alerts-vejby-k9x2m7q4w8
  • Priority ranges from 1 (min) to 5 (urgent). The highest priority gives a more prominent alert on the phone. Use it only for things that require immediate action, otherwise people stop reacting.
  • Tags such as warning and rotating_light are shown as icons in front of the title.
  • Use only plain letters without å, ä and ö in headers. In the message itself, Swedish characters work as normal.

Send from scripts and programs

From PowerShell in Windows, for example at the end of a backup script:

Invoke-RestMethod -Method Post -Uri "https://ntfy.sh/alerts-vejby-k9x2m7q4w8" `
  -Headers @{ Title = "Backup"; Priority = "high"; Tags = "warning" } `
  -Body "Last night's backup failed"

From Python:

import requests

requests.post(
    "https://ntfy.sh/alerts-vejby-k9x2m7q4w8",
    data="The disk on the file server is 95 % full".encode("utf-8"),
    headers={"Title": "File server", "Priority": "high"},
)

Many programs also have ntfy built in, for example the monitoring tool Uptime Kuma. Programs that can only send a webhook work too: the content is then shown as the message text.

Keep your alerts private

On the public server ntfy.sh, topics are open. Anyone who knows or guesses the name can both read and send messages. That is enough for many people, but follow three rules:

  • Use a long, random topic name and do not share it.
  • Do not send sensitive information, such as passwords, personal data or customer data. An alert should say what has happened, not contain data.
  • Bear in mind that messages are stored on the server for a while. On ntfy.sh they are kept for twelve hours so that phones that have been offline have time to fetch them.

For businesses there are two better options: a paid subscription to ntfy.sh with reserved topics and access tokens, or your own server.

Run your own ntfy server

ntfy is a single program and can run on a small server, a NAS or a virtual machine. With Docker:

docker run -d --name ntfy --restart unless-stopped \
  -p 8080:80 \
  -v /etc/ntfy:/etc/ntfy \
  -v /var/cache/ntfy:/var/cache/ntfy \
  binwiederhier/ntfy serve

Then lock the server down to unauthorised users in /etc/ntfy/server.yml:

base-url: "https://ntfy.example.com"
auth-file: "/etc/ntfy/user.db"
auth-default-access: "deny-all"

Create a user and an access token for whoever will send alerts:

docker exec -it ntfy ntfy user add --role=admin anders
docker exec -it ntfy ntfy token add anders

The token starts with tk_ and is sent with every message:

curl -H "Authorization: Bearer tk_yourtoken" -d "Test alert" https://ntfy.example.com/alerts

The server needs to be reachable over HTTPS for the mobile app to connect, for example behind a reverse proxy with a certificate.

Alerts that someone actually sees

  • Decide who receives the alerts, including evenings and weekends, and have at least two people subscribe.
  • Only send alerts that require action. Daily "all OK" messages make the important ones get lost.
  • Test once a month by triggering an alert on purpose.
  • Connect it to intrusion detection. A honeypot or Canarytokens that sends to ntfy means you find out within seconds when someone is snooping around the network.

Frequently Asked Questions

Does ntfy cost anything?

The app and the public server ntfy.sh are free to use. There are paid subscriptions with reserved topics and higher limits, and you can always run your own server for free.

Does ntfy work on iPhone?

Yes, there is an app for both iPhone and Android, and messages can also be shown in the browser.

Is ntfy secure enough for a business?

With your own server, or with reserved topics and access tokens, yes. On the public server without tokens, the alerts should not contain anything sensitive, because anyone who knows the topic name can read them.

Can ntfy replace text message alerts?

For most people, yes. Push notifications get through as long as the phone has internet access. If you want an extra channel, alerts can also be sent to email.

Sources