Deploy Gotify | (Just Updated) Push Notification Server with REST API, Admin Login Preset, Data Survives Redeploys

Gotify push notification server with REST API and WebSocket stream

Deploy Gotify | (Just Updated) Push Notification Server with REST API, Admin Login Preset, Data Survives Redeploys

Just deployed

/app/data

Deploy and Host Gotify on Railway

Built for an LLM agent to deploy and use. There is no setup page to open: the admin account is created from a generated password on first boot, and the contract below lists every address, variable name and one script that creates an application token and sends a message.

Gotify is an open source, self-hosted push notification server. Scripts, CI jobs and AI agents send messages to it over a REST API, and clients (the web UI, the Android app, or any WebSocket listener) receive them in real time. It is a simple HTTP server with a SQLite database, so it idles at a few megabytes of memory.

About Hosting Gotify

This template runs one service: the official gotify/server 3.1.1 image, pinned by digest, with a volume on /app/data. The volume holds the SQLite database (users, applications, tokens, messages), uploaded application images and plugins, so they survive redeploys.

The start command sets the admin user to admin with the password in GOTIFY_DEFAULTUSER_PASS, turns public registration off, and moves Gotify's fixed port 80 to Railway's injected PORT so the healthcheck and the public domain reach it. Gotify applies the default user only while its database is empty, so changing the password variable later does not change the password; change it in the web UI instead. Registration is off, so nobody else can create an account on the public URL.

Agent contract

  • Public URL: GOTIFY_PUBLIC_URL (https:// plus the service's RAILWAY_PUBLIC_DOMAIN). The web UI is at /, the REST API at the same origin.
  • Private URL: http://gotify.railway.internal:8080, exposed as GOTIFY_PRIVATE_URL.
  • Credentials: GOTIFY_DEFAULTUSER_PASS (password of the user admin).
  • Auth: management calls use HTTP Basic auth as admin. Sending a message uses an application token, passed as the X-Gotify-Key header (or ?token=), created by POST /application. Reading a live stream uses a client token created by POST /client, passed on GET /stream as X-Gotify-Key.
  • Health: GET /health returns 200 {"health":"green","database":"green"} without credentials.
  • API: POST /application, GET /application, POST /message, GET /message, POST /client, GET /stream (WebSocket), GET /current/user.
# run with GOTIFY_PUBLIC_URL and GOTIFY_DEFAULTUSER_PASS set
U="$GOTIFY_PUBLIC_URL"
curl -s "$U/health"; echo
curl -s -o /dev/null -w "no auth: %{http_code}\n" "$U/application"
TOKEN=$(curl -s -u "admin:$GOTIFY_DEFAULTUSER_PASS" -H "Content-Type: application/json" \
  -d '{"name":"agent","description":"created by an agent"}' "$U/application" | sed -n 's/.*"token":"\([^"]*\)".*/\1/p')
curl -s -H "X-Gotify-Key: $TOKEN" -d "title=hello" -d "message=sent by an agent" -d "priority=5" "$U/message"; echo
curl -s -u "admin:$GOTIFY_DEFAULTUSER_PASS" "$U/message?limit=1"; echo
curl -s -o /dev/null -w "register closed: %{http_code}\n" -H "Content-Type: application/json" -d '{"name":"x","pass":"y"}' "$U/user"

A fresh deploy prints {"health":"green","database":"green"}, no auth: 401, the sent message as JSON, a message list containing it, and register closed: 401.

Why Deploy Gotify on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Gotify on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

  • Agent-ready - generated admin password, contract block and one working script; nothing to type into the deploy form.
  • No default login - upstream starts with admin / admin; here the password is generated per deploy and registration is off.
  • State survives redeploys - users, application tokens and message history live on one volume.
  • One light service - SQLite on the volume, no Postgres to run alongside, about 5 MB of memory when idle.
  • A working port - the image's fixed port 80 is moved to Railway's injected port, so the healthcheck passes.

Common Use Cases

  • Alerts from scripts and cron jobs - one curl to /message when a backup fails or a deploy finishes.
  • Agent notifications - an AI agent reports progress or asks for attention through a token it created itself.
  • Phone push - the Gotify Android app subscribes to your server over WebSocket, no third-party push service.

Dependencies for Gotify Hosting

  • One Railway volume on /app/data, created by the template.

Deployment Dependencies

Implementation Details

VariablePurpose
GOTIFY_DEFAULTUSER_PASSPassword of the admin user, read on the first boot only. Generated per deploy.
GOTIFY_PUBLIC_URLHTTPS address for clients outside Railway.
GOTIFY_PRIVATE_URLAddress on the private network, for services in the same project.

The start command exports GOTIFY_SERVER_PORT from PORT, GOTIFY_DEFAULTUSER_NAME=admin and GOTIFY_REGISTRATION=false, then runs the image's own gotify-app.


Template Content

More templates in this category

View Template
N8N Main + Worker
Deploy and Host N8N with Inactive worker.

jakemerson
120
View Template
Evolution API with n8n
Automate WhatsApp workflows with Evolution API, n8n, and Postgres.

codestorm
106
View Template
Postgres Backup
Cron-based PostgreSQL backup to bucket storage

Railway Templates
868