How to Install ntfy on Ubuntu Server Latest?
ntfy is an open-source notification system for the command-line interface. It sends notifications about various system events like command completion, file downloads, system failures, etc. In this tutorial, we will explain how to install ntfy on the latest version of Ubuntu Server.
Prerequisites
Before installing ntfy, you must have the following:
- Ubuntu Server with sudo privileges.
- Internet connectivity to download and install packages.
Installing Python and Required Packages
ntfy is written in Python and needs some Python packages to function correctly. Therefore, we need to install Python and other required packages.
Open the terminal by pressing
Ctrl+Alt+T.Update the system by running the following command.
$ sudo apt update && sudo apt upgrade -y
- Install Python 3 and Python package manager
pipby executing the following command.
$ sudo apt install python3 python3-pip -y
- Install required Python packages using pip.
$ sudo pip3 install notify2 psutil requests
Downloading and Installing ntfy
After installing required Python packages, we can now download and install ntfy.
- Download the latest version of ntfy using the following command.
$ sudo curl -L https://github.com/dschep/ntfy/releases/download/v2.1.0/ntfy-2.1.0.tar.gz -o ntfy.tar.gz
You can visit the ntfy releases page to download the latest version.
- Extract the downloaded archive.
$ sudo tar xzf ntfy.tar.gz
- Go to the extracted directory.
$ cd ntfy-2.1.0
- Install ntfy by running the following command.
$ sudo python3 setup.py install
Now you have successfully installed ntfy on your Ubuntu Server.
Using ntfy
To use ntfy, we just need to run a command and it will take care of the rest. For example, to get notifications about completion of long-running commands, we can use the following command.
$ ntfy long-running-command
ntfy will send you a system notification when the command completes.
There are many other use cases for ntfy. You can visit the ntfy GitHub page to learn more.
Conclusion
ntfy is a powerful command-line notification system that can help notify you about important system events. In this tutorial, we learned how to install ntfy on Ubuntu Server latest version. We also explained how to use it to get notifications about commands completion.