ntfy - Android
ntfy (pronounced “notify”) is an open-source push notification service that can be used as a UnifiedPush distributor. You can use it with the default server without needing to sign up to an account.
- License: Apache2 | GPLv2
- Server sources: https://github.com/binwiederhier/ntfy
- Android sources: https://github.com/binwiederhier/ntfy-android
- website: https://ntfy.sh/
- Technology: WebSockets (default) or HTTP JSON stream (Like HTTP Server Sent Events)
Install the latest version of the application from one of the following sources:
- Open the ntfy app after installation.
- Grant the necessary permissions (e.g., notifications and battery optimization exemptions) to ensure it runs properly in the background.
- Open Settings
- Choose a Server:
- Use the public server at https://ntfy.sh (default).
- If you’re self-hosting ntfy, enter your server’s URL (e.g., https://ntfy.example.com).
- Open the app you want to use with UnifiedPush (check this list for compatible apps).
- Look for the Push Notification Settings or UnifiedPush Settings in the app.
- Select ntfy as the UnifiedPush distributer
- Save the settings, and the app will now use ntfy to deliver push notifications.
- Trigger a test notification from the app you chose.
- Ensure that the notification is delivered to your device successfully.
If you prefer to self-host ntfy, follow the official installation guide: ntfy Self-Hosting Documentation.
ntfy includes a built-in Matrix gateway that converts Matrix Push Format messages into the UnifiedPush format. Important: You must configure the base-url for the Matrix gateway to function. Refer to the ntfy documentation for setup details.
By default, ntfy allows anyone to use the server. While push URLs are secret and generally secure, you may want to restrict access to prevent misuse of server resources. Follow these steps to lock down your server:
- Create or edit the config.yml file (default location: /etc/ntfy/config.yml).
- Add the following lines to enable access control:
auth-file: "/var/lib/ntfy/user.db" # Path to the user database
auth-default-access: "deny-all" # Restrict access to only authorized users
- Restart the ntfy server. This will create the user.db file.
- Create a user with the following command:
⠀ntfy user add --role=admin someuser
- Replace someuser with your desired username.
- The –role=admin flag is optional but grants administrative privileges.
- Set a password when prompted.
To allow a user to only subscribe to UnifiedPush topics:
ntfy access someuser 'up*' read-only
To allow a user to subscribe and publish to all topics (including UnifiedPush):
ntfy access someuser '*' read-write
To ensure apps can send notifications via UnifiedPush, make UnifiedPush topics (which start with up*) writable by anyone:
`ntfy access '*' 'up*' write-only`
- Open the ntfy app and go to Settings -> Manage Users -> Add New User.
- Enter your server URL (e.g., https://ntfy.example.com).
- Provide the username and password you created earlier.
- You might want to adjust the user DB path to something like /etc/ntfy/user.db, or mount /var/lib/ntfy as a volume to keep it somewhere safe.
- You will probably want to use docker exec -it ntfy-container-name ntfy instead of ntfy (replace ntfy-container-name with the appropriate one).
- For instance, with the command docker exec -it ntfy-container-name ntfy user add –role=admin someuser