Skip to the content.

Push Notifications with ntfy

ntfy (notify) is a free, open-source, HTTP-based pub-sub notification service. You can send push notifications to your phone or desktop with a simple curl request — no registration or API key required.

How It Works

  1. Pick a topic name (it acts like a channel). Use a hard-to-guess name — anyone who knows the topic can read and post messages.
  2. Subscribe to the topic in the mobile app: ”+” → “Subscribe to topic”, enter the topic name, keep ntfy.sh as the server.
  3. Publish messages to https://ntfy.sh/<topic> via HTTP POST.

Messages are cached on the server for ~12 hours, so a device that subscribes later still receives recent messages.

Sending Messages with curl

# Simple message
curl -d "Your message here" ntfy.sh/<topic>

# With title and priority
curl -H "Title: My Title" -H "Priority: high" -d "Your message" ntfy.sh/<topic>

# Send a file's content as the message
curl --data-binary @file.txt ntfy.sh/<topic>

Priority Levels

Value Behavior
min Lowest priority, no vibration/sound
low No notification sound
default Standard notification (default)
high Pops up on screen, may bypass Do Not Disturb
urgent Highest priority, triggers alarm-like notification

Useful Headers

Example: Notify When a Long Task Finishes

python3 example.py && curl -d "Task finished" ntfy.sh/<topic>

Add a single && curl ... line to any script or CI pipeline to get a push notification when the job completes or fails:

make build || curl -d "Build FAILED" -H "Priority: urgent" ntfy.sh/<topic>

Notes