Aisle Monitoring

ntfy

Send notifications to your phone.

Add to my serverdocker-compose generator (French)Step-by-step guide (French)Official documentation

What is it for?

ntfy sends notifications to your phone with a simple web request. Your scripts, backups and apps can tell you when something happens.

Who is it for?

People who want their scripts and servers to alert them on their phone.

Good to know

By default, anyone who knows a topic name can post to it: pick hard-to-guess names, or turn on access control.

After installing

  1. Install the ntfy app on your phone, add the server https://ntfy.mydomain.com and subscribe to a topic.
  2. Test it: curl -d "Hello!" https://ntfy.mydomain.com/my-topic

The docker-compose

Example behind Traefik. To adapt it (Nginx Proxy Manager, local port…) with a line-by-line explanation, use the generator (in French).

# docker-compose.yml : ntfy
services:
  ntfy:
    image: binwiederhier/ntfy:latest
    container_name: ntfy
    command: serve
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    environment:
      NTFY_BASE_URL: https://ntfy.mydomain.com
      NTFY_CACHE_FILE: /var/cache/ntfy/cache.db
      NTFY_BEHIND_PROXY: "true"
      TZ: Europe/Paris
    volumes:
      - ./cache:/var/cache/ntfy
      - ./etc:/etc/ntfy
    networks:
      - traefik
    labels:
      - traefik.enable=true
      - traefik.http.routers.ntfy.rule=Host(`ntfy.mydomain.com`)
      - traefik.http.routers.ntfy.entrypoints=websecure
      - traefik.http.routers.ntfy.tls.certresolver=letsencrypt
      - traefik.http.services.ntfy.loadbalancer.server.port=80

networks:
  traefik:
    external: true