Back to articles
Technology Insight

Building a High-Speed, Real-Time Push Notification Service with Gotify on Your Own Cloud VPS

June 3, 2026

Introduction: The Need for Self-Hosted Push Notification Infrastructure

In modern enterprise environments and software architectures, real-time communication is no longer a luxury—it is a critical operational requirement. Whether it is a critical system failure alert, an automated DevOps pipeline status update, or real-time transactional data updates, businesses rely heavily on instant notifications to make data-driven decisions. While third-party services like Firebase Cloud Messaging (FCM), Pusher, or OneSignal are popular, they often come with hidden costs: data privacy compliance risks, vendor lock-in, and unpredictable latency variations.

For organizations seeking absolute control over their data stream, privacy compliance (such as GDPR or HIPAA), and sub-millisecond delivery speeds, building a self-hosted notification server is the ultimate strategy. This is where Gotify shines. Gotify is an open-source, lightweight, and incredibly fast self-hosted notification server designed explicitly for sending and receiving messages via WebSockets and REST APIs. In this comprehensive technical guide, we will walk through the architecture, deployment, and optimization of Gotify on a private Cloud VPS.

---

Why Gotify? Evaluating the Open-Source Powerhouse

Before diving into the implementation, it is vital to understand why Gotify stands out against proprietary and open-source alternatives like Matrix or NTFY:

  • Minimal Footprint: Written in Go, Gotify features an ultra-low memory and CPU footprint, allowing it to process thousands of requests per second even on entry-level Cloud VPS instances.
  • True Real-Time Performance: By utilizing persistent WebSocket connections, Gotify bypasses the overhead of traditional HTTP polling, ensuring notifications land instantly.
  • Robust API Ecosystem: Its simple REST API makes it trivial to integrate with existing backend systems, shell scripts, CI/CD tools (like Jenkins, GitHub Actions), and monitoring tools (like Prometheus/Alertmanager).
  • Native Android and Web Clients: Gotify provides a clean web UI and an official Android application that uses background services to maintain high-speed connectivity without heavy battery drain.
Note on iOS: Because of Apple's strict background processing limitations, Gotify does not natively support continuous WebSockets on iOS. For iOS environments, alternative forwarding layers or unified clients are recommended.
---

System Architecture and Prerequisites

To establish a production-ready, highly secure Gotify service, we will deploy a layered architecture. Rather than exposing the Gotify application directly to the public internet, we will place it behind a Reverse Proxy (Nginx or Traefik) to handle SSL/TLS termination securely.

1. Hardware & System Requirements

Gotify is highly efficient. A baseline production environment requires:

  • Cloud VPS: 1 vCPU, 1 GB RAM, and 20 GB SSD (Ubuntu 22.04 LTS or 24.04 LTS recommended).
  • Domain Name: A registered domain or subdomain (e.g., push.yourcompany.com) pointed to your VPS IP via an A record.
  • Network Ports: Ports 80 (HTTP) and 443 (HTTPS) must be open in your firewall.

2. Software Stack

We will leverage Docker and Docker Compose for containerization. This ensures our environment remains isolated, reproducible, and easy to upgrade.

---

Step-by-Step Deployment Guide

Follow these detailed steps to deploy your high-speed notification service from scratch.

Step 1: Preparing the Server and Docker Installation

Connect to your Cloud VPS via SSH and update the core system packages to their latest stable versions:

sudo apt update && sudo apt upgrade -y

Next, install Docker and Docker Compose using the official repository script:

curl -fsSL [https://get.docker.com](https://get.docker.com) -o get-docker.sh
sudo sh get-docker.sh
sudo apt-get install docker-compose-plugin -y

Step 2: Configuring the Docker Compose Stack

Create a dedicated directory for your Gotify deployment to organize configuration files and persistent data volumes:

mkdir -p ~/gotify-stack && cd ~/gotify-stack

Now, create a docker-compose.yml file to define the Gotify application service along with an automated Nginx reverse proxy and Let's Encrypt SSL companion container for frictionless security management:

version: '3.8'

services:
  gotify:
    image: gotify/server:latest
    container_name: gotify_server
    restart: always
    ports:
      - "8080:80"
    environment:
      - GOTIFY_SERVER_PORT=80
      - GOTIFY_SERVER_KEEPALIVEPERIODSECONDS=30
      - GOTIFY_SERVER_LISTENADDR=0.0.0.0
      - GOTIFY_REGISTRATION=false
    volumes:
      - ./gotify_data:/app/data

Configuration Insight: Setting GOTIFY_REGISTRATION=false is a critical security best practice for private business servers. It prevents unauthorized external users from registering accounts on your notification portal.

Step 3: Launching the Service

Execute the docker-compose command to download the images and spin up the services in detached background mode:

sudo docker compose up -d

Verify that the containers are healthy and running via: sudo docker ps.

---

Securing Your Infrastructure with Nginx and SSL

To ensure notifications containing sensitive system data are encrypted in transit, configuring an SSL reverse proxy is non-negotiable. Below is a production-grade Nginx configuration snippet designed to handle persistent WebSocket connections seamlessly:

server {
    listen 443 ssl http2;
    server_name push.yourcompany.com;

    ssl_certificate /etc/letsencrypt/live/[push.yourcompany.com/fullchain.pem](https://push.yourcompany.com/fullchain.pem);
    ssl_certificate_key /etc/letsencrypt/live/[push.yourcompany.com/privkey.pem](https://push.yourcompany.com/privkey.pem);

    location / {
        proxy_pass http://localhost:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # Critical WebSocket Support Settings
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";

        # Timeout management for long-lived connections
        proxy_connect_timeout 7d;
        proxy_send_timeout 7d;
        proxy_read_timeout 7d;
    }
}

The Upgrade and Connection headers are what allow the client to transition seamlessly from a standard HTTP request to a persistent, low-overhead WebSocket stream, eliminating connection dropouts.

---

Testing and Integrating Your Gotify API

Once your setup is online, navigate to your domain, log in using the default credentials (admin / admin), and immediately change the password via the User interface.

1. Creating an Application Token

To send a notification, navigate to the "Apps" tab and create a new application (e.g., "Server Monitor"). Gotify will generate a unique application token (e.g., A__Ag3vB5X9z1p).

2. Sending an Alert via cURL

Integrating Gotify into your backend microservices, bash scripts, or automation routines is incredibly simple. Use a standard POST request:

curl -X POST "[https://push.yourcompany.com/message?token=A__Ag3vB5X9z1p](https://push.yourcompany.com/message?token=A__Ag3vB5X9z1p)" \
     -F "title=Backup Alert" \
     -F "message=The automated database backup completed successfully." \
     -F "priority=5"

Gotify supports customizable message priorities ranging from 0 (lowest/silent) to 10 (highest/critical), allowing your clients to change notification behavior or sound profiles dynamically based on severity.

---

Performance Tuning for Large-Scale Deployment

If your business processes millions of notifications daily, you must tune both the underlying Linux kernel and the application parameters to maximize performance:

  1. Increase Linux File Descriptors: Each active WebSocket client consumes a file descriptor. Modify /etc/security/limits.conf and add * soft nofile 65535 to ensure your system can handle massive numbers of simultaneous connections.
  2. Database Optimization: By default, Gotify uses SQLite, which is ideal for low-to-medium traffic. For high-velocity enterprise throughput, modify your Gotify environment variables to plug into a dedicated PostgreSQL or MySQL cluster.
  3. Keep-Alive Tweaking: Ensure the GOTIFY_SERVER_KEEPALIVEPERIODSECONDS value aligns with your corporate network firewall timeouts to prevent premature connection terminations.
---

Conclusion: Ultimate Privacy and Unmatched Speeds

By shifting away from cloud-hosted third-party notification silos and establishing your own Gotify node on a private Cloud VPS, you unlock unrivaled control over your internal notification ecosystem. Your data remains entirely in-house, your real-time processing speeds are constrained only by raw hardware capacity, and your operational costs drop significantly down to a flat VPS subscription fee. Start building your infrastructure today to secure and supercharge your business communication pipeline.

Building a High-Speed, Real-Time Push Notification Service with Gotify on Your Own Cloud VPS | DPTCloud