A push notification server written in Go (Golang).
A push notification micro server using Gin framework written in Go (Golang) and see the demo app.
Get started with gorush in 3 simple steps:
# 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!"
}]
}' Platform codes: 1 = iOS (APNS), 2 = Android (FCM), 3 = Huawei (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.
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/api/stat/app show notification success and failure counts./api/config show your YAML config.p8, p12 or pem format of iOS certificate file./sys/stats show response time, status code count, etc.Performance: Average memory usage ~28MB. Supports high-throughput notification delivery with configurable workers and queue systems.
Gorush uses YAML configuration. Create a config.yml file with your settings:
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"…See the complete example config file.
The easiest way to install gorush is using the install script:
curl -fsSL https://raw.githubusercontent.com/appleboy/gorush/master/install.sh | bashThis will automatically:
~/.gorush/bin# 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 | bashDownload from releases page:
brew tap appleboy/tap
brew install gorush# Latest stable version
go install github.com/appleboy/gorush@latest
# Development version
go install github.com/appleboy/gorush@mastergit clone https://github.com/appleboy/gorush.git
cd gorush
make build
# Binary will be in the root directory# 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# Use default config (port 8088)
./gorush
# Use custom config file
./gorush -c config.yml
# Set specific options
./gorush -p 9000 -c config.ymlPrerequisites: Generate FCM service account key from Firebase Console → Settings → Service Accounts → Generate New Private Key.
# 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: 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: 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"curl http://localhost:8088/healthzcurl -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"
}]
}'# 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…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 |
POST /api/push{
"notifications": [
{
"tokens": ["ios_device_token"],
"platform": 1,
"title": "Hello iOS",
"message": "Hello World iOS!"
}
]
}{
"notifications": [
{
"tokens": ["android_device_token"],
"platform": 2,
"title": "Hello Android",
"message": "Hello World Android!"
}
]
}{
"notifications": [
{
"tokens": ["huawei_device_token"],
"platform": 3,
"title": "Hello Huawei",
"message": "Hello World Huawei!"
}
]
}{
"notifications": [
{
"tokens": ["ios_device_token"],
"platform": 1,
"title": "Important Alert",
"message": "Critical notification",
"apns": {
"payload": {
"aps": {
"sound":The read me doesn't tend to load properly
Concurrent iOS pushes can be delivered to the wrong APNs host
FCM token are deprecated
Missing Authentication on HTTP API Allows Unauthenticated Push Notification Abuse
Debian package
Bug in configuration read in Redis Sentinel Section for "stats:"
Feature request: Add HMAC signature support for feedback URLs
webpush support ?
How to customise Android notifications sounds
Duplicated notifications