ntfy (Push Notification Service)
What this is
A lightweight self-hosted push notification service that allows sending alerts to devices via HTTP, scripts, or apps.
Why I set this up
I wanted a simple way to:
- Receive alerts from my homelab (containers, scripts, failures)
- Integrate notifications with automation tools
- Avoid relying on third-party notification services
Where it runs
- Host: micropc (192.168.86.100)
- Network: bridge
- Access (local): http://192.168.86.100:6741
- External access: None (local-only)
Docker Compose
services:
ntfy:
image: binwiederhier/ntfy:latest
container_name: ntfy
command:
- serve
- --config
- /etc/ntfy/server.yml
environment:
- TZ=Europe/London
volumes:
- ./cache:/var/cache/ntfy
- ./auth:/var/lib/ntfy
- ./config/server.yml:/etc/ntfy/server.yml
ports:
- 6741:80
restart: unless-stopped
ntfy:
image: binwiederhier/ntfy:latest
container_name: ntfy
command:
- serve
- --config
- /etc/ntfy/server.yml
environment:
- TZ=Europe/London
volumes:
- ./cache:/var/cache/ntfy
- ./auth:/var/lib/ntfy
- ./config/server.yml:/etc/ntfy/server.yml
ports:
- 6741:80
restart: unless-stopped
Key Configuration Notes
Network
- Uses bridge networking
- Accessible via port
6741 - No special networking requirements
Storage
./cache→ message cache and attachments./auth→ user authentication data./config/server.yml→ main configuration file
👉 All stored under:
/opt/docker/ntfy/
Special Config
- Custom config file:
/etc/ntfy/server.yml
- Timezone set via
TZ - Optional:
- Authentication
- Access control
- Rate limiting
Setup Steps
- Create folder:
mkdir -p /opt/docker/ntfy/{cache,auth,config}
cd /opt/docker/ntfy
cd /opt/docker/ntfy
- Create config file:
nano config/server.yml
- Add basic config (example):
base-url: "http://192.168.86.100:6741"
listen-http: ":80"
cache-file: "/var/cache/ntfy/cache.db"
auth-file: "/var/lib/ntfy/auth.db"
listen-http: ":80"
cache-file: "/var/cache/ntfy/cache.db"
auth-file: "/var/lib/ntfy/auth.db"
- Create compose file:
nano docker-compose.yml
- Start container:
docker compose up -d
Problems / Fixes
Cannot access web UI
- Cause: Container not running or wrong port
- Fix:
docker ps
docker compose restart
docker compose restart
Notifications not received
- Cause: Incorrect topic or URL
- Fix:
- Verify:
http://SERVER_IP:6741/<topic>
Config changes not applied
- Cause: Container not restarted
- Fix:
docker compose restart
Permission issues
- Cause: Incorrect folder ownership
- Fix:
sudo chown -R 1000:1000 /opt/docker/ntfy
Result
- ntfy accessible via browser
- Can send notifications via:
- curl
- scripts
- apps
- Persistent storage for messages and auth
Notes
- Works great with:
- cron jobs
- Docker monitoring (e.g. DIUN)
- Home Assistant automations
- Can be exposed externally later via reverse proxy if needed
- Keep config backed up (part of
/opt/docker) - Topics are created dynamically — no setup required
No comments to display
No comments to display