CHECKING STATUS
I AM LISTENING TO
|

Day 7: NTFY Self-Hosted Push Notification Service – 7 Days of Docker

16. February 2025
.SHARE

Table of Contents

Introduction

ntfy is a powerful, self-hosted push notification service that allows you to send messages to your devices via HTTP, MQTT, or WebSockets. Running ntfy in a Docker container makes deployment and management easy, ensuring a lightweight and scalable notification system.

This guide walks you through setting up ntfy with Docker, configuring it, and making the most of its features.

Prerequisites

Before we begin, ensure you have:

  • Docker installed on your machine (Get Docker)
  • (Optional) Docker Compose for easier configuration

1: Pull the ntfy Docker Image

The official ntfy image is available on Docker Hub. To pull it, run:

This command downloads the latest ntfy image to your system.

2: Run ntfy as a Docker Container

A simple way to start ntfy is by running the following command:

This starts ntfy as a background service (-d), mapping the container’s port 80 to the host’s port 80.

You can now access ntfy by visiting http://localhost.

3: Persisting Data with a Volume

To keep your settings and messages after a container restart, you should mount a volume:

This ensures that all data is stored in a persistent volume called ntfy_data.

4: Custom Configuration

For advanced settings, create a custom config file:

  1. Create a directory for ntfy:
  1. Create a server.yml file with custom settings:
  1. Run ntfy with the custom configuration:

This mounts your local ~/ntfy directory as the ntfy storage location, allowing persistent configuration.

5: Sending Notifications

Once ntfy is running, you can send notifications using cURL:

Or using the ntfy CLI:

6: Running with Docker Compose (Optional)

That is how I currently use it.

portalZINE NMN | Development meets Creativity | portalzine nmn development meets creativity blog 36

Using Docker Compose simplifies container management. Create a docker-compose.yml file:

Start the service with:

Thoughts

Running ntfy with Docker is an efficient way to manage notifications on your own infrastructure. Whether you’re using it for server monitoring, IoT notifications, or personal alerts, ntfy provides a lightweight and flexible solution.

There are also nice apps for Desktop and Mobile.

I am using it actively for all my CRON notifications and much more … https://portalzine.de/wordpress-cron-wp-cli-ntfy

Let’s Talk!

Looking for a reliable partner to bring your project to the next level? Whether it’s development, design, security, or ongoing support—I’d love to chat and see how I can help.

Get in touch,
and let’s create something amazing together!

RELATED POSTS

Or: How I Learned to Stop Worrying and Love the Underscore Remember when you could just tell your computer what to do, in plain English, and it would actually do it? No? Well, grab your DeLorean, because we’re going back to the future with _hyperscript (yes, that underscore is part of the name, and yes, […]

As Visual Studio Code continues to dominate the code editor landscape in 2025, developers working with remote servers face an important decision: which SFTP extension should they use? The marketplace offers numerous options, but not all extensions are created equal. Some have been abandoned by their maintainers, while others have evolved into robust, actively maintained […]

Hey there! So you wanna build a Chrome extension? Awesome! It’s way easier than you think. Seriously, you can have a basic one running in like 5 minutes. Let me walk you through everything you need to know. Just build a leads data extractor for myself and a client! Not my first Chrome Extension, but […]

Alexander

I am a full-stack developer. My expertise include:

  • Server, Network and Hosting Environments
  • Data Modeling / Import / Export
  • Business Logic
  • API Layer / Action layer / MVC
  • User Interfaces
  • User Experience
  • Understand what the customer and the business needs


I have a deep passion for programming, design, and server architecture—each of these fuels my creativity, and I wouldn’t feel complete without them.

With a broad range of interests, I’m always exploring new technologies and expanding my knowledge wherever needed. The tech world evolves rapidly, and I love staying ahead by embracing the latest innovations.

Beyond technology, I value peace and surround myself with like-minded individuals.

I firmly believe in the principle: Help others, and help will find its way back to you when you need it.