← Documentation: Menu Order Push Notifications


ntfy receives HTTP messages from n8n and delivers them to subscribed devices. This guide deploys your own server with topic authentication; remote devices will connect through HTTPS in the next guide.

1. Prepare Docker storage and networking

Create /opt/ntfy/config, /opt/ntfy/data and /opt/ntfy/cache. Make data and cache writable by the container. The example assumes an existing n8n-net network shared with n8n.

Add this service under services in Docker Compose:

ntfy:
  image: binwiederhier/ntfy:latest
  container_name: ntfy
  command: serve
  ports:
    - "127.0.0.1:8095:80"
  volumes:
    - /opt/ntfy/config:/etc/ntfy:ro
    - /opt/ntfy/data:/var/lib/ntfy
    - /opt/ntfy/cache:/var/cache/ntfy
  networks:
    - n8n-net        # use the same network as n8n
  restart: unless-stopped

The loopback port is for a proxy running on the host. n8n can reach http://ntfy directly on the shared Docker network.

2. Configure the server

Save the following as /opt/ntfy/config/server.yml, replacing the public hostname:

base-url: "https://ntfy.YOUR_DOMAIN.com"
listen-http: ":80"

cache-file: "/var/cache/ntfy/cache.db"
cache-duration: "12h"

auth-file: "/var/lib/ntfy/user.db"
auth-default-access: "deny-all"     # ← blocks all anonymous access

behind-proxy: true

attachment-cache-dir: "/var/cache/ntfy/attachments"
attachment-total-size-limit: "2G"
attachment-file-size-limit: "15M"

log-level: info

Start the service with docker compose up -d ntfy. Restart it after configuration changes. deny-all keeps anonymous access disabled.

3. Create topic access

Create separate publisher and subscriber accounts for the same topic:

docker exec -it ntfy ntfy user add n8n-orders
docker exec ntfy ntfy access n8n-orders YOUR_TOPIC write-only
docker exec ntfy ntfy token add n8n-orders
docker exec -it ntfy ntfy user add phone
docker exec ntfy ntfy access phone YOUR_TOPIC read-only

Save the publisher token for the n8n Header Auth credential. Use the phone account in the mobile app. See ntfy access control for account and token management.

4. Continue with HTTPS

Follow 02 - Expose ntfy with Cloudflare Tunnel. Then subscribe the app to the configured topic and confirm delivery with authentication, while anonymous topic access remains denied.