Railway

Deploy gotify

Gotify — self-hosted push notification server with web UI and API.

Deploy gotify

Just deployed

/app/data

Gotify

Gotify

A self-hosted push notification server for sending & receiving messages.

Deploy on Railway GitHub Stars License

Gotify Deploy on Railway


✨ 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

Deploy on Railway

Click the button above to deploy Gotify instantly on Railway.

Prerequisites

  • A Railway account
  • (Optional) A Postgres plugin for production database — or use the built-in SQLite

⚙️ Environment Variables

VariableRequiredDefaultDescription
PORTNo8080HTTP listen port (must match Dockerfile EXPOSE)
GOTIFY_SERVER_BINDADDRESSNo0.0.0.0Server bind address
GOTIFY_DEFAULTUSER_NAMENoadminDefault admin username (first-run only)
GOTIFY_DEFAULTUSER_PASSNoadminDefault admin password (first-run only)
GOTIFY_DATABASE_DIALECTNosqlite3Database type: sqlite3, mysql, or postgres
GOTIFY_DATABASE_CONNECTIONNodata/gotify.dbDatabase connection string
GOTIFY_REGISTRATIONNofalseAllow public user registration
GOTIFY_SERVER_LOG_LEVELNoinfoLog level: debug, info, warning, error
GOTIFY_FILE_SIZENo20Max upload size in MB
GOTIFY_UPLOADEDIMAGES_DIRNodata/imagesUploaded 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

  1. Add a Postgres plugin to your Railway project
  2. Set these environment variables:
    GOTIFY_DATABASE_DIALECT=postgres
    GOTIFY_DATABASE_CONNECTION=${{Postgres.DATABASE_URL}}
    
  3. 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

IssueSolution
Health check failingEnsure PORT environment variable matches 8080. Check Railway logs for startup errors.
Data lost on restartGotify 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 inDefault credentials: admin / admin. If you changed them and forgot, reset by clearing the database.
Port conflictEnsure only one service uses port 8080. Change PORT environment variable if needed.
Slow first startupThe Docker image is ~12MB. First pull may take a moment on cold starts.
404 on API endpointsVerify you're using the correct path. API base is /. Full endpoint: POST /message.

📚 Resources

📄 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

More templates in this category

View Template
Rocky Linux
[Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
19
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
50