Gotify Push Notifications
Gotify self-hosted push notification server with web and mobile apps.
Overview
Gotify is a simple self-hosted server for sending and receiving messages in real-time, originally developed as a lightweight alternative to proprietary push notification services like Firebase Cloud Messaging or Apple Push Notifications. Built in Go with a SQLite database backend, Gotify enables developers and system administrators to send push notifications through a REST API to web browsers, Android devices, and desktop applications without relying on third-party services or sharing data with external providers.
This Docker stack deploys a complete Gotify notification server with persistent data storage and automatic user provisioning. The server provides both a web interface for managing applications and clients, plus a REST API for sending notifications programmatically. Applications authenticate using unique tokens to send messages, while clients use separate tokens to receive notifications, creating a secure separation between senders and receivers.
This configuration is ideal for developers building custom applications, homelab enthusiasts monitoring services, small teams needing internal notifications, and organizations requiring data sovereignty over their messaging infrastructure. The lightweight nature of Gotify makes it perfect for deployment on single-board computers, VPS instances, or as part of larger self-hosted ecosystems alongside monitoring tools like Prometheus or home automation platforms.
Key Features
- Real-time WebSocket connections for instant message delivery to web clients and mobile apps
- Multi-application support with individual API tokens for different services and projects
- Plugin system for extending functionality with custom message processing and integrations
- Message priority levels with different notification behaviors and retention policies
- Web-based administration interface for managing applications, clients, and message history
- Android mobile application with customizable notification sounds and vibration patterns
- REST API with comprehensive documentation for programmatic message sending and management
- SQLite database backend with automatic schema migrations and data integrity checks
Common Use Cases
- 1Home automation systems sending alerts for security events, sensor readings, and device status changes
- 2CI/CD pipeline notifications for build failures, deployment completions, and code review requests
- 3Server monitoring and alerting for system resource usage, service failures, and backup completion status
- 4Small team collaboration with custom application notifications for task assignments and project updates
- 5Development environment integration for test results, error logging, and debugging information
- 6Personal productivity applications with reminders, calendar events, and habit tracking notifications
- 7IoT device management with sensor alerts, device offline notifications, and data collection status updates
Prerequisites
- Docker Engine 20.10 or later with Docker Compose V2 support
- Minimum 128MB RAM allocation for the Gotify container and SQLite operations
- Available port 8080 on the host system for web interface and API access
- Environment variables configured: TZ (timezone), GOTIFY_USER (admin username), GOTIFY_PASS (admin password)
- Basic understanding of REST API concepts for application token management and message sending
- Android device or web browser for receiving and testing push notifications
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 gotify: 3 image: gotify/server:latest4 container_name: gotify5 environment: 6 - TZ=${TZ}7 - GOTIFY_DEFAULTUSER_NAME=${GOTIFY_USER}8 - GOTIFY_DEFAULTUSER_PASS=${GOTIFY_PASS}9 volumes: 10 - gotify_data:/app/data11 ports: 12 - "8080:80"13 restart: unless-stopped14 networks: 15 - gotify-network1617volumes: 18 gotify_data: 1920networks: 21 gotify-network: 22 driver: bridge.env Template
.env
1# Gotify2TZ=UTC3GOTIFY_USER=admin4GOTIFY_PASS=admin123Usage Notes
- 1Web UI at http://localhost:8080
- 2Create app tokens for senders
- 3CLI and Android apps available
- 4Plugin support
- 5REST API for integration
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 gotify:5 image: gotify/server:latest6 container_name: gotify7 environment:8 - TZ=${TZ}9 - GOTIFY_DEFAULTUSER_NAME=${GOTIFY_USER}10 - GOTIFY_DEFAULTUSER_PASS=${GOTIFY_PASS}11 volumes:12 - gotify_data:/app/data13 ports:14 - "8080:80"15 restart: unless-stopped16 networks:17 - gotify-network1819volumes:20 gotify_data:2122networks:23 gotify-network:24 driver: bridge25EOF2627# 2. Create the .env file28cat > .env << 'EOF'29# Gotify30TZ=UTC31GOTIFY_USER=admin32GOTIFY_PASS=admin12333EOF3435# 3. Start the services36docker compose up -d3738# 4. View logs39docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/gotify-notifications/run | bashTroubleshooting
- Error 'database is locked' during startup: Stop the container completely and check for orphaned SQLite processes accessing the volume
- Messages not appearing in Android app: Verify the client token is correct and disable battery optimization for the Gotify app in Android settings
- WebSocket connection failed in browser: Check firewall rules allowing port 8080 and ensure the container is running with proper network configuration
- Plugin installation fails with permission error: Verify the gotify_data volume has correct ownership and the container has write access to /app/data/plugins
- Admin user cannot login after first startup: Check environment variables GOTIFY_DEFAULTUSER_NAME and GOTIFY_DEFAULTUSER_PASS are properly set and restart the container
- API requests return 401 unauthorized: Ensure application tokens are generated correctly through the web interface and included in the X-Gotify-Key header
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Ad Space
Shortcuts: C CopyF FavoriteD Download