Install Ntfy using Docker on Ubuntu 24.04
Ntfy is a self-hosted push notification service that lets you send messages to phones, browsers, or command-line clients with ease. It supports simple HTTP requests, MQTT, and CLI commands, making it perfect for system alerts, application events, and IoT integrations. Running Ntfy in a Docker container provides a fast, consistent deployment on any modern Linux server. With Ubuntu 24.04 LTS (Noble Numbat), you gain a stable, secure, and long-supported foundation—ideal for personal setups or production-grade environments.
Architecture Overview
Layer | Component | Purpose |
---|---|---|
OS | Ubuntu 24.04 LTS | Modern, secure base with long-term updates |
Runtime | Docker Engine | Runs the Ntfy container for consistent deployment |
Application | Ntfy | Push notification server with web UI and REST API |
Storage | Host Volumes | Persistent cache and configuration |
Network | Port 80 | Exposes Ntfy web UI and API |
Why Use Ntfy?
-
Instant Notifications – Send messages to clients in real time with just a single HTTP POST.
-
Self-Hosted Privacy – Keep your topics and messages under your full control.
-
Simple API – Publish and subscribe using cURL, CLI, or MQTT.
-
Lightweight & Efficient – Runs in a single Docker container with minimal resource usage.
-
Cross-Platform Clients – Works with Android, iOS, desktop, and browser-based apps.
Step-by-Step Installation
1. Connect to Your Server
Log in to your Ubuntu 24.04 server via SSH:
2. Update and Install Prerequisites
Update system packages:
Install required dependencies:
3. Install Docker
Install Docker from Ubuntu’s repositories:
Verify the installation:
4. Prepare Persistent Directories
Create directories for cache and configuration to ensure data survives container restarts:
5. Pull and Run the Ntfy Container
Download the official Ntfy image:
Run the container:
Explanation of key parameters
-
-p 80:80
exposes the Ntfy web interface and API on port 80. -
-v /var/cache/ntfy
stores the persistent message cache. -
-v /etc/ntfy
stores configuration files. -
--restart unless-stopped
ensures Ntfy restarts automatically after a reboot.
6. Access the Web Interface
Open a browser and visit:
The Ntfy dashboard will appear, ready for you to create topics and send messages.