Deploy gotify
Gotify — self-hosted push notification server with web UI and API.
Just deployed
/app/data
Gotify
A self-hosted push notification server for sending & receiving messages.
✨ Features
- Push Notifications — Send notifications to your devices from any application or script
- REST API — Simple HTTP API for programmatic message sending
- Web Interface — Built-in admin UI for managing users, apps, and clients
- Multi-Platform Clients — Android app, WebSocket, and CLI tools available
- User Management — Multi-user support with permission controls
- Message Priorities — Assign priority levels to notifications
- Plugin System — Extend functionality with community plugins
- Lightweight — Single Go binary, ~12MB, runs on minimal resources
🚀 Deploy on Railway
One-Click Deploy
Click the button above to deploy Gotify instantly on Railway.
Prerequisites
⚙️ Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
PORT | No | 8080 | HTTP listen port (must match Dockerfile EXPOSE) |
GOTIFY_SERVER_BINDADDRESS | No | 0.0.0.0 | Server bind address |
GOTIFY_DEFAULTUSER_NAME | No | admin | Default admin username (first-run only) |
GOTIFY_DEFAULTUSER_PASS | No | admin | Default admin password (first-run only) |
GOTIFY_DATABASE_DIALECT | No | sqlite3 | Database type: sqlite3, mysql, or postgres |
GOTIFY_DATABASE_CONNECTION | No | data/gotify.db | Database connection string |
GOTIFY_REGISTRATION | No | false | Allow public user registration |
GOTIFY_SERVER_LOG_LEVEL | No | info | Log level: debug, info, warning, error |
GOTIFY_FILE_SIZE | No | 20 | Max upload size in MB |
GOTIFY_UPLOADEDIMAGES_DIR | No | data/images | Uploaded images directory |
🔒 Recommended Production Configuration
For production deployments, Railway automatically generates the RAILWAY_PUBLIC_DOMAIN variable. Gotify will bind to the provided port and Railway handles TLS termination at the edge.
Change your admin password immediately after first login.
📡 Service Dependencies
┌──────────────────────────────────────────────────────┐
│ Gotify Server │
│ Port 8080 │
├─────────────────┬──────────────────┬─────────────────┤
│ SQLite (file) │ REST API (/ ) │ Web UI (/ ) │
│ (default, │ POST /message │ Manage apps, │
│ persistent) │ GET /health │ users, clients │
└─────────────────┴──────────────────┴─────────────────┘
│ │ │
│ ┌─────┴──────┐ │
│ │ │ │
┌────┴─────┐ ┌────┴────┐ ┌────┴────┐ ┌────┴────┐
│ Android │ │ CLI │ │ WebSocket│ │ Plugins │
│ Client │ │ gotify │ │ Clients │ │ (opt.) │
└──────────┘ └─────────┘ └─────────┘ └─────────┘
Using with Railway Postgres Plugin
- Add a Postgres plugin to your Railway project
- Set these environment variables:
GOTIFY_DATABASE_DIALECT=postgres GOTIFY_DATABASE_CONNECTION=${{Postgres.DATABASE_URL}} - Redeploy — Gotify will auto-migrate to PostgreSQL
💻 Local Development
Prerequisites
- Docker installed on your machine
Quick Start
# Clone the repository
git clone https://github.com/INAPP-Mobile/railway-gotify.git
cd railway-gotify
# Build and run with Docker
docker build -t gotify-server .
docker run -d \
--name gotify \
-p 8080:8080 \
-e GOTIFY_DEFAULTUSER_NAME=admin \
-e GOTIFY_DEFAULTUSER_PASS=admin \
-v gotify-data:/app/data \
gotify-server
# Open in browser
open http://localhost:8080
Using Docker Compose
services:
gotify:
build: .
ports:
- "8080:8080"
environment:
- GOTIFY_DEFAULTUSER_NAME=admin
- GOTIFY_DEFAULTUSER_PASS=admin
- GOTIFY_DATABASE_DIALECT=sqlite3
- GOTIFY_DATABASE_CONNECTION=data/gotify.db
volumes:
- gotify-data:/app/data
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8080/health"]
interval: 30s
timeout: 3s
retries: 3
start_period: 10s
volumes:
gotify-data:
Sending Test Messages
Once Gotify is running, send a test notification:
# Using curl
curl -X POST "http://localhost:8080/message?token=YOUR_APP_TOKEN" \
-F "title=Hello" \
-F "message=This is a test notification" \
-F "priority=5"
🔧 Troubleshooting
| Issue | Solution |
|---|---|
| Health check failing | Ensure PORT environment variable matches 8080. Check Railway logs for startup errors. |
| Data lost on restart | Gotify stores SQLite data in /app/data/. Railway provides ephemeral storage — database is persisted within the service's filesystem. For production, use Railway Postgres plugin. |
| Cannot log in | Default credentials: admin / admin. If you changed them and forgot, reset by clearing the database. |
| Port conflict | Ensure only one service uses port 8080. Change PORT environment variable if needed. |
| Slow first startup | The Docker image is ~12MB. First pull may take a moment on cold starts. |
| 404 on API endpoints | Verify you're using the correct path. API base is /. Full endpoint: POST /message. |
📚 Resources
- Gotify Documentation — Official docs
- Gotify API Reference — REST API documentation
- GitHub Repository — Source code & issues
- Android Client — Mobile client for notifications
- CLI Tool — Command-line interaction
📄 License
This template deploys Gotify, which is licensed under the MIT License. See the LICENSE file for details.
Deploy and Host
Deploy this template on Railway with one click. Railway provides compute, TLS at the edge, and a public URL. The service restarts automatically on failures.
About Hosting
This template runs as a single container with no external database dependencies. All data is stored using built-in storage — no PostgreSQL, Redis, or additional services required.
Why Deploy
- One-click deploy — No configuration, no setup, just deploy
- Zero external dependencies — Single container, no external database needed
- Automatic HTTPS — Railway provisions TLS certificates automatically
- Self-healing — Automatic restarts on failure
- Persistent storage — Optional Railway volume for data persistence
Common Use Cases
- Self-hosted service for personal or team use
- Production deployment with zero maintenance overhead
- Privacy-focused alternative to cloud-hosted solutions
- Lightweight deployment on Railway's free tier
Dependencies for
Deployment Dependencies
Gotify requires no external dependencies. It uses embedded SQLite for message and user storage by default.
- Railway Account — hosting platform
- No external database, cache, or message queue required
Template Content
