
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
gotify
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'sRAILWAY_PUBLIC_DOMAIN). The web UI is at/, the REST API at the same origin. - Private URL:
http://gotify.railway.internal:8080, exposed asGOTIFY_PRIVATE_URL. - Credentials:
GOTIFY_DEFAULTUSER_PASS(password of the useradmin). - Auth: management calls use HTTP Basic auth as
admin. Sending a message uses an application token, passed as theX-Gotify-Keyheader (or?token=), created byPOST /application. Reading a live stream uses a client token created byPOST /client, passed onGET /streamasX-Gotify-Key. - Health:
GET /healthreturns 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
curlto/messagewhen 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
| Variable | Purpose |
|---|---|
GOTIFY_DEFAULTUSER_PASS | Password of the admin user, read on the first boot only. Generated per deploy. |
GOTIFY_PUBLIC_URL | HTTPS address for clients outside Railway. |
GOTIFY_PRIVATE_URL | Address 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
gotify
gotify/server:3.1.1