🔔 Setup ntfy — Self-Hosted Push Notifications

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.

⚠️ This script is provided for demo and testing purposes only. Not intended for production use.

📦 Resources & Setup Scripts

Grab the automated bash script from GitHub to follow along with the video.

Automated install script — ntfy notification server in one command.
View on GitHub

Quick Install:

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/communication/ntfy/ntfy-ubuntu.sh
chmod +x ntfy-ubuntu.sh
sudo bash ntfy-ubuntu.sh

Tutorial Steps

1 Download & Run the Script

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

2 Send Your First Notification

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

3 Subscribe from Your Phone

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.

4 Integrate with Scripts & Cron Jobs

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

Ports Used

PortPurpose
8095ntfy Web UI & API