docker.recipes

Gotify Push Notifications

beginner

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:latest
4 container_name: gotify
5 environment:
6 - TZ=${TZ}
7 - GOTIFY_DEFAULTUSER_NAME=${GOTIFY_USER}
8 - GOTIFY_DEFAULTUSER_PASS=${GOTIFY_PASS}
9 volumes:
10 - gotify_data:/app/data
11 ports:
12 - "8080:80"
13 restart: unless-stopped
14 networks:
15 - gotify-network
16
17volumes:
18 gotify_data:
19
20networks:
21 gotify-network:
22 driver: bridge

.env Template

.env
1# Gotify
2TZ=UTC
3GOTIFY_USER=admin
4GOTIFY_PASS=admin123

Usage Notes

  1. 1Web UI at http://localhost:8080
  2. 2Create app tokens for senders
  3. 3CLI and Android apps available
  4. 4Plugin support
  5. 5REST API for integration

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 gotify:
5 image: gotify/server:latest
6 container_name: gotify
7 environment:
8 - TZ=${TZ}
9 - GOTIFY_DEFAULTUSER_NAME=${GOTIFY_USER}
10 - GOTIFY_DEFAULTUSER_PASS=${GOTIFY_PASS}
11 volumes:
12 - gotify_data:/app/data
13 ports:
14 - "8080:80"
15 restart: unless-stopped
16 networks:
17 - gotify-network
18
19volumes:
20 gotify_data:
21
22networks:
23 gotify-network:
24 driver: bridge
25EOF
26
27# 2. Create the .env file
28cat > .env << 'EOF'
29# Gotify
30TZ=UTC
31GOTIFY_USER=admin
32GOTIFY_PASS=admin123
33EOF
34
35# 3. Start the services
36docker compose up -d
37
38# 4. View logs
39docker compose logs -f

One-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 | bash

Troubleshooting

  • 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

Components

gotify

Tags

#gotify#notifications#push#alerts#self-hosted

Category

Message Queues & Brokers
Ad Space