Gotify solves a simple but common self-hosting problem: how do you get a notification when a backup finishes, a server goes down, or a temperature sensor fires an alert? Rather than routing those messages through a commercial service, Gotify gives you a tiny server you control — paired with an Android app or any HTTP client — that delivers real-time push notifications to wherever you are.
Why Gotify?
- Simple API: Sending a notification is a single HTTP POST request with a message and a priority. Any script, cron job, or IoT device that can make an HTTP call can push to Gotify.
- Self-contained: The server is a single Go binary with no external runtime dependencies, and the Docker image is correspondingly small and fast to start.
- Multi-client: The official Android app receives messages via a persistent WebSocket connection. There are also community clients for other platforms and browser extensions.
Gotify with Docker
The compose file below pairs Gotify with a PostgreSQL database for reliable message persistence. The default SQLite mode works but Postgres is the better choice for production use.
docker --version
Docker Compose
services:
gotify:
image: ghcr.io/gotify/server:2.6
container_name: gotify
restart: always
ports:
- "6886:80" # Web UI and API
environment:
- GOTIFY_DATABASE_DIALECT=postgres
- GOTIFY_DATABASE_CONNECTION=host=postgres port=5432 user=gotify dbname=gotify password=change_this_password sslmode=disable
- GOTIFY_DEFAULTUSER_NAME=admin
- GOTIFY_DEFAULTUSER_PASS=change_this_too
- GOTIFY_REGISTRATION=false
- TZ=Europe/Madrid # Set your timezone
depends_on:
postgres:
condition: service_healthy
volumes:
- gotify_data:/app/data
networks:
- gotify_net
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
postgres:
image: postgres:17.2
container_name: gotify_db
restart: always
environment:
POSTGRES_DB: gotify
POSTGRES_USER: gotify
POSTGRES_PASSWORD: change_this_password # Must match the password in the connection string
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- gotify_net
healthcheck:
test: ["CMD-SHELL", "pg_isready -U gotify -d gotify"]
interval: 10s
timeout: 5s
retries: 5
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
gotify_data:
postgres_data:
networks:
gotify_net:
driver: bridge
Change the passwords in both GOTIFY_DATABASE_CONNECTION and the postgres service environment before deploying. Start it with:
docker compose up -d
Accessing Gotify
The Gotify web UI and API are available at:
http://localhost:6886
Log in with the credentials you set in GOTIFY_DEFAULTUSER_NAME and GOTIFY_DEFAULTUSER_PASS. From the UI you can create application tokens, which are what you use in your scripts to send messages.
Conclusion
Gotify is one of the leanest self-hosted notification solutions available. Five minutes of setup gives you a permanent, private alternative to Pushover or Pushbullet that you can integrate into any script or monitoring system. Wire it into Uptime Kuma for downtime alerts, trigger it from n8n workflows, or fire it from Home Assistant automations. New to Docker? Start with the containers primer.
The Gotify project
FAQ
How do I send a notification?
A single curl call. Create an application in the Gotify UI, copy its token, and POST to /message:
curl -X POST "http://localhost:6886/message?token=YOUR_APP_TOKEN" \
-F "title=Backup done" \
-F "message=All volumes archived" \
-F "priority=5"
Any language with an HTTP client can do this. That is the entire integration story.
Can I get push notifications on my phone?
Yes — install the official Android app from F-Droid or Google Play, point it at your server, log in, and it keeps a persistent WebSocket open. iOS support is via third-party apps; check the Gotify docs for the current list.
Why does Gotify need PostgreSQL? Isn't SQLite enough?
Gotify vs ntfy vs Pushover — which one?
Gotify is the most batteries-included self-hosted option (web UI, applications, persistent storage). ntfy is more minimal — pub/sub style, often run without auth on a topic-namespaced URL. Pushover is the polished commercial option with iOS support out of the box. For a private home lab where you control the recipient device, Gotify is the sweet spot.
Is there a way to set message priorities?
Yes — priority 1-10. Most clients render >=5 as a heads-up notification and <5 as silent. Set thresholds per application in the Android app to avoid waking up at 3 AM for a dev cron job.
How do I expose Gotify safely to the internet?
Behind a reverse proxy with HTTPS — see the Nginx Proxy Manager guide. Gotify’s WebSocket needs the proxy to forward upgrade headers correctly, which NPM does by default.
Comments