Overview
Discover what makes ntfy powerful
**ntfy** is a lightweight, HTTP‑based publish/subscribe notification service written in Go. From a developer’s standpoint it exposes a RESTful API that accepts `PUT` or `POST` requests and pushes the payload to all active subscribers of a topic. Topics are created on demand; subscribing or publishing creates the namespace automatically, making it trivial to bootstrap a notification channel without any provisioning steps. The service is designed for high concurrency, leveraging Go’s goroutine model and an in‑memory message queue backed by a durable append‑only log on disk. This architecture allows ntfy to handle thousands of simultaneous connections with minimal latency while ensuring that messages are persisted until delivery or TTL expiration.
Language & Runtime
Networking
Data Layer
Pub‑Sub Engine
Overview
ntfy is a lightweight, HTTP‑based publish/subscribe notification service written in Go. From a developer’s standpoint it exposes a RESTful API that accepts PUT or POST requests and pushes the payload to all active subscribers of a topic. Topics are created on demand; subscribing or publishing creates the namespace automatically, making it trivial to bootstrap a notification channel without any provisioning steps. The service is designed for high concurrency, leveraging Go’s goroutine model and an in‑memory message queue backed by a durable append‑only log on disk. This architecture allows ntfy to handle thousands of simultaneous connections with minimal latency while ensuring that messages are persisted until delivery or TTL expiration.
Architecture
- Language & Runtime: Pure Go (1.20+), compiled to a single static binary that runs on any platform with a compatible OS kernel.
- Networking: Exposes an HTTPS endpoint (TLS termination optional; can be delegated to a reverse proxy).
- Data Layer: Uses a lightweight file‑based key/value store (BoltDB/Badger) for topic metadata and message persistence. The log‑structured storage guarantees crash safety and fast sequential writes, which is ideal for push workloads.
- Pub‑Sub Engine: Internally implements a fan‑out model where each topic maintains a list of active WebSocket or long‑poll connections. Delivery guarantees are at least once with optional acknowledgments for critical workflows.
- Extensibility: The core is intentionally minimal; hooks are exposed for custom authentication, rate limiting, and message filtering via middleware. The API is documented on
pkg.go.devand a dedicated/docs/section provides examples in multiple languages (Go, Python, JavaScript, PowerShell).
Core Capabilities
- REST API:
PUT /<topic>orPOST /<topic>with optional headers (Content-Type,Priority,Tags,Icon,Attachment) to enrich notifications. - WebSocket/HTTP Long‑Poll: Clients subscribe via
GET /<topic>which upgrades to WebSocket if supported, otherwise falls back to HTTP streaming. - Priorities & Actions: Supports priority levels (low, normal, high, urgent) that map to native notification styles on Android/iOS/desktop. Action buttons can trigger webhook callbacks or custom URLs.
- Attachments: Binary payloads (images, files) can be uploaded alongside text notifications; the server streams them to clients with proper MIME handling.
- Topic Lifecycle: Topics expire after a configurable TTL if no activity occurs, freeing resources automatically.
- Metrics & Health: Exposes Prometheus metrics (
ntfy_http_requests_total,ntfy_messages_sent) and a/healthzendpoint for readiness probes.
Deployment & Infrastructure
- Self‑Hosting: A single binary plus a configuration file (
config.yaml) is sufficient. The app can run in Docker, Kubernetes, or directly on a VM/VMware instance. - Containerization: Official Docker images are available on Docker Hub (
binwiederhier/ntfy). They expose the default port 80 (or 443 for TLS) and are compatible with Helm charts or custom manifests. - Scalability: Because each node owns its own topics, horizontal scaling is achieved via a shared storage layer (e.g., NFS or Ceph) and a load balancer that routes to the correct node based on topic hashing. The stateless nature of the HTTP endpoints makes it trivial to add replicas.
- High Availability: Pair with a reverse proxy (Traefik, Nginx) that handles TLS termination and can perform health checks. The built‑in
/healthzendpoint ensures graceful draining during rolling updates.
Integration & Extensibility
- SDKs: The Go client library (
heckel.io/ntfy/v2) mirrors the API and can be embedded in services for tighter integration. - Webhooks: Notifications can trigger external HTTP callbacks, enabling automation pipelines (e.g., Slack alerts, PagerDuty incidents).
- Plugins: The server accepts custom middleware via the
--pluginsflag, allowing developers to plug in authentication backends (OAuth2, JWT), rate limits, or custom routing logic. - Custom Topics: With ntfy Pro you can reserve topic names, preventing accidental namespace collisions in shared environments.
- CLI & SDKs: The bundled
ntfyCLI (available on all major OSes) can be scripted in CI/CD pipelines, and the library supports typed payloads for strongly‑typed languages.
Developer Experience
- Documentation: The official docs are hosted at
https://ntfy.sh/docs/and cover all aspects from basic usage to advanced configuration. - Community: Active Discord, Matrix rooms, and a dedicated GitHub Discussions forum provide quick support.
- Testing: The repository includes comprehensive unit and integration tests, with CI running on GitHub Actions.
- Open Source Licensing: Released under Apache‑2.0, allowing commercial use without attribution requirements while preserving contributor rights.
Use Cases
- Infrastructure Monitoring – Emit alerts from Prometheus or custom scripts to a mobile device for on‑call engineers.
- Home Automation – Push sensor events (motion, door open) to a phone or desktop with actionable buttons (e.g., “Turn on lights”).
- **CI/CD
Open SourceReady to get started?
Join the community and start self-hosting ntfy today
Related Apps in apis-services
Mastodon
Decentralized, real‑time social networking
Discourse
Open‑source community forum platform with real‑time chat and AI
Rocket.Chat
Secure, open‑source team communication platform
Novu
Unified notification platform for multi‑channel delivery
Mattermost
Secure, self‑hosted team collaboration with chat, voice, and AI
Jitsi Meet
Free, encrypted video conferencing for everyone
Weekly Views
Repository Health
Information
Explore More Apps
Mafl
Customizable, privacy‑first homepage organizer
Dagu
Lightweight YAML‑based workflow engine with a modern web UI
Domain Locker
Central hub for managing and monitoring all your domain names
Geo2tz
Self-hosted Geo‑to‑Timezone lookup service
Sylius
Developer‑friendly eCommerce framework for custom B2C/B2B solutions
Signature PDF
Free web tool for signing, editing and managing PDFs
