Deploy ntfy on Ubuntu with Docker — a beautifully simple HTTP-based pub/sub notification service. Send push notifications to your phone or desktop from any script, cron job, or application with a single HTTP request.
Grab the automated bash script from GitHub to follow along with the video.
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/communication/ntfy/ntfy-ubuntu.sh
chmod +x ntfy-ubuntu.sh
sudo bash ntfy-ubuntu.sh
The script installs Docker and starts the ntfy server with persistent storage for message history.
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/communication/ntfy/ntfy-ubuntu.sh
chmod +x ntfy-ubuntu.sh
sudo bash ntfy-ubuntu.sh
Send a test notification with a simple curl command. Topics are created on-the-fly — no signup required:
curl -d "Backup finished successfully!" http://<your-server-ip>:8095/alerts
Install the ntfy app on Android or iOS. Tap "Add subscription" → "Use another server" → enter your server URL and the topic name (e.g. "alerts"). You'll receive push notifications instantly whenever something publishes to that topic.
Add ntfy notifications to any shell script or cron job. You can set priority, tags, and titles using HTTP headers for richer notifications:
curl -H "Title: Server Alert" \
-H "Priority: urgent" \
-H "Tags: warning,computer" \
-d "Disk usage exceeded 90%!" \
http://<your-server-ip>:8095/alerts
| Port | Purpose |
|---|---|
| 8095 | ntfy Web UI & API |