LIVEReading: Get Phone Alerts From Any Script — Free With ntfyTotal time: 7 minSteps: 6Worked first time: 95% LIVEReading: Get Phone Alerts From Any Script — Free With ntfyTotal time: 7 minSteps: 6Worked first time: 95%
CBW
Get Phone Alerts From Any Script — Free With ntfy
Easygithub.com/binwiederhier/ntfy2026-06-22

Get Phone Alerts From Any Script — Free With ntfy

ntfy lets you send push notifications to your phone or desktop with a single curl command — no account, no app key, no fees. Use the free public server or run your own.

// Build stats

  • Total time7 min
  • Number of steps6
  • DifficultyEasy
  • Worked first time95%
// Before you start

What you need

  • A phone with the ntfy app installed (Android: Google Play or F-Droid / iOS: App Store)
  • A terminal on any computer (Mac, Linux, or Windows with WSL)
  • curl installed — it comes pre-installed on most systems
01
Step 1 of 6

Install the ntfy app on your phone

3 min

The ntfy app is what receives the notifications on your device. Search for 'ntfy' in the Google Play Store or Apple App Store and install it. It is free and open source. You do not need to create an account.

Terminal · mac
$ # No command needed — install from your phone's app store.
$ # Android: https://play.google.com/store/apps/details?id=io.heckel.ntfy
$ # iOS: https://apps.apple.com/us/app/ntfy/id1625396347
$ # F-Droid: https://f-droid.org/en/packages/io.heckel.ntfy/
What you should see
The ntfy app opens on your phone.
02
Step 2 of 6

Pick a unique topic name

1 min

ntfy works like a public radio channel. Anyone who knows your topic name can send you messages. Pick something hard to guess — treat it like a weak password. You do NOT register it anywhere; you just start using it. Example: 'mikes-server-alerts-x7q2'. Write it down — you will use it in every step below.

Terminal · mac
$ # No command. Just decide on a topic name.
$ # Rules: letters, numbers, hyphens, underscores only. No spaces.
$ # Example: my-alerts-a8f3k
What you should see
You have a topic name written down.
This might happen

If you pick a short or common topic name like 'test' or 'alerts', strangers may accidentally (or intentionally) send noise to your phone.

Add random characters to the end, e.g. 'alerts-k9x2m'. The public server has no authentication on free topics.

03
Step 3 of 6

Subscribe to your topic in the app

1 min

Open the ntfy app on your phone, tap the '+' or 'Subscribe to topic' button, and type in the topic name you chose. Leave the server set to 'ntfy.sh' (the default). Tap Subscribe. The app is now listening for messages on that topic.

Terminal · mac
$ # Done inside the phone app — no terminal command needed.
What you should see
Your topic appears in the app's topic list with zero messages.
04
Step 4 of 6

Send your first notification from the terminal

1 min

This is the core trick: one curl command sends a push notification to every device subscribed to your topic. Replace YOUR-TOPIC-NAME with the name you chose in Step 2. Run this from any computer that has internet access.

Terminal · mac
$ curl -d "Hello from my computer!" ntfy.sh/YOUR-TOPIC-NAME
What you should see
Your phone buzzes with a notification that says "Hello from my computer!". The terminal prints a short JSON response like: {"id":"abc123","time":1700000000,"event":"message","topic":"YOUR-TOPIC-NAME","message":"Hello from my computer!"}
This might happen

curl: command not found on Windows (outside WSL).

Open PowerShell and run: curl.exe -d "Hello from my computer!" ntfy.sh/YOUR-TOPIC-NAME — Windows 10/11 ships curl.exe natively in PowerShell.

05
Step 5 of 6

Add a title, priority, and emoji tag

2 min

ntfy supports extra headers that control how the notification looks. You can set a title, an urgency level (1=min, 3=default, 5=max), and an emoji tag that appears as an icon. This is useful when you want different alerts to look different at a glance.

Terminal · mac
$ curl \
$ -H "Title: Backup finished" \
$ -H "Priority: high" \
$ -H "Tags: white_check_mark" \
$ -d "Last night's backup completed successfully." \
$ ntfy.sh/YOUR-TOPIC-NAME
What you should see
A notification arrives on your phone with the title 'Backup finished', a ✅ icon, and the message body. High-priority notifications may make a louder sound depending on your phone settings.
This might happen

Multi-line curl commands with backslashes fail on Windows Command Prompt.

Use PowerShell or WSL, or put the whole command on one line separated by spaces.

06
Step 6 of 6

Drop the command into any script

3 min

The real power is automation. Paste the curl line at the end of any shell script — a backup job, a cron task, a server health check — and you get a phone alert every time it runs. Here is a minimal example that notifies you when a file finishes downloading.

Terminal · mac
$ # Example: notify when a large download finishes
$ wget https://releases.ubuntu.com/24.04/ubuntu-24.04-desktop-amd64.iso && \
$ curl -d "Ubuntu ISO download complete!" ntfy.sh/YOUR-TOPIC-NAME
What you should see
When wget finishes, curl fires and your phone receives the notification.
This might happen

The free ntfy.sh server rate-limits to roughly 250 messages per day per visitor IP.

For high-volume use, self-host ntfy on your own server. See https://docs.ntfy.sh/install/ — it runs as a single binary or Docker container.

// Status

cooked. baked. worked.

You can send a push notification to your phone from any terminal in the world with a single curl command, and you can embed that command in any script to get automatic alerts for backups, downloads, server events, or anything else.

// the honest bit

The honest part

The free ntfy.sh public server is convenient but your topic name is the only protection — there is no password on free topics. Anyone who guesses your topic name can read or send messages. For sensitive alerts (server passwords, personal data), either use a hard-to-guess topic name or self-host ntfy with access control enabled. The public server also caps free accounts at 250 messages/day and messages expire after 12 hours. Self-hosting removes all these limits but requires a server you control.