Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

gorush

> 编程语言
Open source

A push notification server written in Go (Golang).

8.7K stars0 likes1 views
WebsiteGitHub

About

A push notification server written in Go (Golang).

gorush

A push notification micro server using Gin framework written in Go (Golang) and see the demo app.

Quick Start

Get started with gorush in 3 simple steps:

bash
# 1. Download the latest binary
wget https://github.com/appleboy/gorush/releases/download/v1.18.9/gorush-1.18.9-linux-amd64 -O gorush
chmod +x gorush

# 2. Start the server (default port 8088)
./gorush

# 3. Send your first notification
curl -X POST http://localhost:8088/api/push \
  -H "Content-Type: application/json" \
  -d '{
    "notifications": [{
      "tokens": ["your_device_token"],
      "platform": 2,
      "title": "Hello World",
      "message": "Your first notification!"
    }]
  }'

Contents

  • Quick Start - Get up and running in 3 steps
  • Support Platform - iOS, Android, Huawei
  • Features - What gorush can do
  • Configuration - YAML config and options
    • Basic Configuration
    • Advanced Configuration
  • Installation - Binary, package managers, Docker, source
    • Recommended: Install Script
    • Manual Download
    • Package Managers
    • Build from Source
    • Docker
  • Usage - CLI commands and REST API examples
    • Starting the Server
    • Command Line Notifications
    • REST API Usage
    • CLI Options Reference
  • Web API - Complete API reference
    • Overview
    • Send Notifications
    • Statistics APIs
    • Request Parameters
  • Deployment - Docker, Kubernetes, AWS Lambda, gRPC
    • Docker Deployment
    • Kubernetes
    • AWS Lambda
    • Netlify Functions
    • gRPC Service
  • FAQ - Common issues and best practices
    • Common Issues
    • Performance Tips
    • Security Best Practices
  • Stargazers over time
  • License

Support Platform

Platform codes: 1 = iOS (APNS), 2 = Android (FCM), 3 = Huawei (HMS)

  • APNS
  • FCM
  • HMS

A live server on Netlify and get notification token on Firebase Cloud Messaging web. You can use the token to send a notification to the device.

bash
curl -X POST \
     -H "Content-Type: application/json" \
     -d '{
  "notifications": [
    {
      "tokens": [
        "your_device_token"
      ],
      "platform": 2,
      "title": "Test Title",
      "message": "Test Message"
    }
  ]
}' \
  https://gorush.netlify.app/api/push

Features

  • Support Firebase Cloud Messaging using go-fcm library for Android.
  • Support HTTP/2 Apple Push Notification Service using apns2 library.
  • Support HMS Push Service using go-hms-push library for Huawei Devices.
  • Support YAML configuration.
  • Support command line to send single Android or iOS notification.
  • Support Web API to send push notification.
  • Support HTTP/2 or HTTP/1.1 protocol.
  • Support notification queue and multiple workers.
  • Support /api/stat/app show notification success and failure counts.
  • Support /api/config show your YAML config.
  • Support store app stat to memory, Redis, BoltDB, BuntDB, LevelDB or BadgerDB.
  • Support p8, p12 or pem format of iOS certificate file.
  • Support /sys/stats show response time, status code count, etc.
  • Support for HTTP, HTTPS or SOCKS5 proxy.
  • Support retry send notification if server response is fail.
  • Support expose prometheus metrics.
  • Support install TLS certificates from Let's Encrypt automatically.
  • Support send notification through RPC protocol, we use gRPC as default framework.
  • Support running in Docker, Kubernetes or AWS Lambda (Native Support in Golang)
  • Support graceful shutdown that workers and queue have been sent to APNs/FCM before shutdown service.
  • Support different Queue as backend like NSQ, NATS or Redis streams, default engine is local Channel.

Performance: Average memory usage ~28MB. Supports high-throughput notification delivery with configurable workers and queue systems.

Configuration

Gorush uses YAML configuration. Create a config.yml file with your settings:

Basic Configuration

yaml
core:
  port: "8088" # HTTP server port
  worker_num: 0 # Workers (0 = CPU cores)
  queue_num: 8192 # Queue size
  mode: "release" # or "debug"

# Enable platforms you need
android:
  enabled: true
  key_path: "fcm-key.json" # FCM service account key

ios:
  enabled: true
  key_path: "apns-key.pem" # APNS certificate
  production: true # Use production APNS

huawei:
  enabled: false
  appid: "YOUR_APP_ID"
  appsecret: "YOUR_APP_SECRET"

Advanced Configuration

Click to expand full configuration options
…

See the complete example config file.

Installation

Recommended: Install Script

The easiest way to install gorush is using the install script:

bash
curl -fsSL https://raw.githubusercontent.com/appleboy/gorush/master/install.sh | bash

This will automatically:

  • Detect your OS and architecture
  • Download the latest version
  • Install to ~/.gorush/bin
  • Add to your PATH

Options

bash
# Install specific version (replace X.Y.Z with the desired version, e.g., 1.19.2)
VERSION=X.Y.Z curl -fsSL https://raw.githubusercontent.com/appleboy/gorush/master/install.sh | bash

# Custom install directory
INSTALL_DIR=/usr/local/bin curl -fsSL https://raw.githubusercontent.com/appleboy/gorush/master/install.sh | bash

# Skip SSL verification (not recommended)
INSECURE=1 curl -fsSL https://raw.githubusercontent.com/appleboy/gorush/master/install.sh | bash

Manual Download

Download from releases page:

Package Managers

Homebrew (macOS/Linux)

bash
brew tap appleboy/tap
brew install gorush

Go Install

bash
# Latest stable version
go install github.com/appleboy/gorush@latest

# Development version
go install github.com/appleboy/gorush@master

Build from Source

Requirements: Go 1.25+, Git

bash
git clone https://github.com/appleboy/gorush.git
cd gorush
make build
# Binary will be in the root directory

Docker

bash
# Run directly
docker run --rm -p 8088:8088 appleboy/gorush

# With custom config
docker run --rm -p 8088:8088 -v $(pwd)/config.yml:/home/gorush/config.yml appleboy/gorush

Usage

Starting the Server

bash
# Use default config (port 8088)
./gorush

# Use custom config file
./gorush -c config.yml

# Set specific options
./gorush -p 9000 -c config.yml

Command Line Notifications

Android (FCM) Command Line

Prerequisites: Generate FCM service account key from Firebase Console → Settings → Service Accounts → Generate New Private Key.

bash
# Android: Single notification
gorush -android -m "Hello Android!" --fcm-key "path/to/fcm-key.json" -t "device_token"

# Android: Using environment variable (recommended)
export GOOGLE_APPLICATION_CREDENTIALS="path/to/fcm-key.json"
gorush -android -m "Hello Android!" -t "device_token"

# Android: Topic message
gorush --android --topic "news" -m "Breaking News!" --fcm-key "path/to/fcm-key.json"

iOS (APNS) Command Line

bash
# iOS: Development environment
gorush -ios -m "Hello iOS!" -i "cert.pem" -t "device_token" --topic "com.example.app"

# iOS: Production environment
gorush -ios -m "Hello iOS!" -i "cert.pem" -t "device_token" --topic "com.example.app" -production

# iOS: With password-protected certificate
gorush -ios -m "Hello iOS!" -i "cert.p12" -P "cert_password" -t "device_token"

Huawei (HMS) Command Line

bash
# Huawei: Single notification
gorush -huawei -title "Hello" -m "Hello Huawei!" -hk "APP_SECRET" -hid "APP_ID" -t "device_token"

# Huawei: Topic message
gorush --huawei --topic "updates" -title "Update" -m "New version available" -hk "APP_SECRET" -hid "APP_ID"

REST API Usage

Health Check

bash
curl http://localhost:8088/healthz

Send Notifications

bash
curl -X POST http://localhost:8088/api/push \
  -H "Content-Type: application/json" \
  -d '{
    "notifications": [{
      "tokens": ["device_token_1", "device_token_2"],
      "platform": 2,
      "title": "Hello World",
      "message": "This is a test notification"
    }]
  }'

Get Statistics

bash
# Application stats
curl http://localhost:8088/api/stat/app

# Go runtime stats
curl http://localhost:8088/api/stat/go

# System stats
curl http://localhost:8088/sys/stats

# Prometheus metrics
curl http://localhost:8088/metrics

CLI Options Reference

Click to expand all CLI options
…

Web API

Overview

Gorush provides RESTful APIs for sending notifications and monitoring system status:

Endpoint Method Description
/api/push POST Send push notifications
/api/stat/app GET Application statistics
/api/stat/go GET Go runtime statistics
/sys/stats GET System performance metrics
/metrics GET Prometheus metrics
/healthz GET Health check
/api/config GET Current configuration

Send Notifications - POST /api/push

Basic Examples

iOS (APNS) API
json
{
  "notifications": [
    {
      "tokens": ["ios_device_token"],
      "platform": 1,
      "title": "Hello iOS",
      "message": "Hello World iOS!"
    }
  ]
}
Android (FCM) API
json
{
  "notifications": [
    {
      "tokens": ["android_device_token"],
      "platform": 2,
      "title": "Hello Android",
      "message": "Hello World Android!"
    }
  ]
}
Huawei (HMS) API
json
{
  "notifications": [
    {
      "tokens": ["huawei_device_token"],
      "platform": 3,
      "title": "Hello Huawei",
      "message": "Hello World Huawei!"
    }
  ]
}

Advanced Examples

iOS with Custom Sound
json
{
  "notifications": [
    {
      "tokens": ["ios_device_token"],
      "platform": 1,
      "title": "Important Alert",
      "message": "Critical notification",
      "apns": {
        "payload": {
          "aps": {
            "sound":

Issues· 68 open

View all issuesOpen on GitHub
  • #883

    The read me doesn't tend to load properly

    Updated Aug 7, 2026
  • #881

    Concurrent iOS pushes can be delivered to the wrong APNs host

    Updated Jul 28, 2026
  • #878

    FCM token are deprecated

    Updated Jun 19, 2026
  • #877

    Missing Authentication on HTTP API Allows Unauthenticated Push Notification Abuse

    Updated Jun 13, 2026
  • #872

    Debian package

    Updated Jun 6, 2026
  • #867

    Bug in configuration read in Redis Sentinel Section for "stats:"

    Updated Apr 13, 2026
  • #871

    Feature request: Add HMAC signature support for feedback URLs

    Updated Apr 12, 2026
  • #248

    webpush support ?

    FeatureUpdated Jan 5, 2026
  • #851

    How to customise Android notifications sounds

    Updated Nov 7, 2025
  • #850

    Duplicated notifications

    bugUpdated Nov 4, 2025

> Tags

Goandroidapnsgcmgolang

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言