NTFY: Send push notifications to your phone

NTFY: Send push notifications to your phone

NTFY is a simple HTTP-based pub-sub notification service. It allows you to send notifications to your phone or desktop via scripts from any computer, and/or using a REST API. It's infinitely flexible, and 100% free software.

PUB-SUB: It is known as the publish-subscribe pattern, which is a messaging pattern where publishers categorize messages into classes that are received by subscribers.

NTFY is a powerful open-source notification tool that can be self-hosted. Suppose a scenario where you are downloading a large file using wget and have to do other work leaving your desktop, but you want to get notified when the task is complete then NTFY comes in handy to use.

Steps to install NTFY

Let's start with the Desktop setup

  • Let us set it without using docker
$ wget https://github.com/binwiederhier/ntfy/releases/download/v2.11.0/ntfy_2.11.0_linux_amd64.deb
$ sudo dpkg -i ntfy_*.deb
$ sudo systemctl start ntfy
  • If you want to enable ntfy on the start of OS then use the following command.
$ sudo systemctl enable ntfy

Using docker

  • The ntfy image is available for amd64, armv6, armv7 and arm64.

  • with persistent cache

$ sudo apt update
$ sudo apt install docker.io -y
$ sudo nano /etc/ntfy/server.yml
  • Now search and change the following code
# Go to the top of the code and uncomment base-url and set the url
# for example
base-url : http/https://your ip address to the internet
# For ISO search for `upstream` in code and uncomment
# In nano press ctrl+w to search
upstream-base-url: "https://ntfy.sh"
# If you use twilio for phone call then find the twilio in the code and give the credential
  • Save the changes and run the docker container
$ sudo docker run -v /var/cache/ntfy:/var/cache/ntfy -v /etc/ntfy:/etc/ntfy -p 80:80 -itd binwiederhier/ntfy serve --cache-file /var/cache/ntfy/cache.db

In Mobile

  • Download the NTFY app from the Play Store, F-droid or App Store.




  • Go to the settings section of the app and Change the default server to the IP address of the base-url that you set early in server.yml

  • Then go to the notification section click on the plus icon and subscribe to a channel named by yourself that should be unique.

Test to push notification

  • Open the terminal and test by using the following command
$ curl -d "Test" (ip-address that you specify in base-url)/channel that you named

For example:

ip-address = and

subscribed channel = ntfytestnotification, then the command will be

$ curl -d "Test"

This should work on iOS and Android devices.

using this you can leave your task and at the end, you can write the above command followed by && as shown in the following example


$ ping -c 3 && curl -d "Host is up" || curl -d "Host is down"

In this above example, is pinged 3 times and

if it gets the response then it will push a notification with the Host is up message

else it will push a notification with the Host is down message.

Check the documentation of NTFY by following this link https://docs.ntfy.sh/ where you can do a bunch of things. Here in this blog, I have mentioned only the installation process.