
Deploy Zulip | (Just Updated) Slack Alternative Team Chat, Owner Login Pre-Created, No Link Step
Zulip team chat server with topic threads, Slack alternative, login set
redis
Just deployed
/data
database
Just deployed
/var/lib/postgresql
Just deployed
/data
rabbitmq
Just deployed
/var/lib/rabbitmq
memcached
Just deployed
Deploy and Host Zulip on Railway
Built for an LLM agent to deploy and use. The deploy form has no fields to fill: the first organization and its owner login are created at first boot, the secrets and the database, cache and queue credentials are generated, and nobody else can register. Zulip is an open-source team chat server where every conversation is a topic inside a channel, with a full REST API, bots, integrations and mobile apps, a self-hosted alternative to Slack.
About Hosting Zulip
This template runs five services: zulip, the official zulip/zulip-server image (docker-zulip release 13.3-0) pinned by digest through a thin wrapper, with a volume at /data for uploads and configuration; database, zulip/zulip-postgresql:14 with a volume at /var/lib/postgresql; memcached, with a SASL account; rabbitmq, with a volume at /var/lib/rabbitmq; and redis, with a volume at /data. One public domain serves Zulip on port 8080, with an HTTP healthcheck at /health that turns green only after the database migrations ran and the first organization exists.
What the wrapper fixes. A stock Zulip container has no account: someone has to run manage.py generate_realm_creation_link inside it and open the link before anybody can sign in, and its settings and secrets are not variables a template can fill. The wrapper maps the template's variables onto Zulip's settings, lets Zulip's own entrypoint run the migrations, creates the first organization and its owner with manage.py create_realm from ADMIN_EMAIL and ADMIN_PASSWORD, and only then opens the public port, a small forwarder to Zulip's nginx that also rewrites Railway's probe host. The organization is invite-only: a stranger who asks to sign up is told to request an invitation, and the registration endpoint refuses them. Redeploys keep the organization, the messages and the uploads.
Using it. Open your domain and log in with the owner e-mail and password from the zulip service variables. An agent calls POST /api/v1/fetch_api_key with the same login to get an API key and sends it with HTTP basic auth on every /api/v1 call. E-mail (invitations by mail, password reset, notifications) and mobile push are not configured; set Zulip's SETTING_EMAIL_HOST family of variables on the zulip service if you need them, or invite people with an invite link from the organization settings.
Agent contract
- Public URL:
https://RAILWAY_PUBLIC_DOMAIN(the generated domain of thezulipservice) - Private URL:
http://zulip.railway.internal:8080 - Credentials: the variables
ADMIN_EMAILandADMIN_PASSWORDon thezulipservice (plain text); the API key is fetched after login - Auth:
POST /api/v1/fetch_api_keywithusernameandpasswordreturnsapi_key; send it as HTTP basic auth (ADMIN_EMAIL:api_key) on every/api/v1call, which answers 401 without it - Health:
GET /api/v1/server_settingsreturns 200 without credentials (Zulip's own/healthis refused to anything but localhost; Railway's probe carries no client address and gets 200)
#!/bin/sh
# needs: RAILWAY_PUBLIC_DOMAIN, ADMIN_EMAIL, ADMIN_PASSWORD (variables of the zulip service); also curl, jq.
R="https://$RAILWAY_PUBLIC_DOMAIN"; JAR=$(mktemp)
n=0; until [ "$(curl -s -o /dev/null -w '%{http_code}' "$R/api/v1/server_settings")" = 200 ]; do n=$((n+1)); [ "$n" -le 120 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/api/v1/server_settings"
# a stranger cannot register: the sign-up page asks for an invitation and the registration endpoint refuses a request that carries no invite key
curl -s -c "$JAR" -b "$JAR" -o /dev/null "$R/register/"
CSRF=$(awk '$6 ~ /csrftoken$/{print $7}' "$JAR")
echo "invite required: $(curl -s -c "$JAR" -b "$JAR" -H "Referer: $R/register/" --data-urlencode "csrfmiddlewaretoken=$CSRF" --data-urlencode "email=stranger@example.com" "$R/register/" | grep -c 'You need an invitation')"
curl -s -o /dev/null -w "public signup: %{http_code}\n" -b "$JAR" -H "Referer: $R/register/" --data-urlencode "csrfmiddlewaretoken=$CSRF" --data-urlencode "full_name=Stranger" --data-urlencode "password=Str4ngerPass99" "$R/accounts/register/"
# the generated owner login: fetch_api_key answers with the key that authenticates every /api/v1 call (HTTP basic: e-mail and key)
KEY=$(curl -s --data-urlencode "username=$ADMIN_EMAIL" --data-urlencode "password=$ADMIN_PASSWORD" "$R/api/v1/fetch_api_key" | jq -r '.api_key')
case "$KEY" in ""|null) echo "login: failed";; *) echo "login: ok";; esac
ME=$(curl -s -u "$ADMIN_EMAIL:$KEY" "$R/api/v1/users/me")
echo "role: $(echo "$ME" | jq -r 'if .is_owner then "owner" else "other" end')"
UID_=$(echo "$ME" | jq -r '.user_id')
# write-auth: POST /api/v1/messages needs the key; without it, or with a wrong one, the answer is 401
curl -s -o /dev/null -w "write with key: %{http_code}\n" -u "$ADMIN_EMAIL:$KEY" --data-urlencode "type=direct" --data-urlencode "to=[$UID_]" --data-urlencode "content=hello from an agent" "$R/api/v1/messages"
curl -s -o /dev/null -w "write without key: %{http_code}\n" --data-urlencode "type=direct" --data-urlencode "to=[$UID_]" --data-urlencode "content=hello from an agent" "$R/api/v1/messages"
curl -s -o /dev/null -w "write wrong key: %{http_code}\n" -u "$ADMIN_EMAIL:wrongkey" --data-urlencode "type=direct" --data-urlencode "to=[$UID_]" --data-urlencode "content=hello from an agent" "$R/api/v1/messages"
Expected output against a fresh deploy:
health: 200
invite required: 1
public signup: 404
login: ok
role: owner
write with key: 200
write without key: 401
write wrong key: 401
The refusals are the contract: a request without a key is refused (write without key: 401), a wrong key is refused (write wrong key: 401), and a stranger cannot register (public signup: 404, and the sign-up page answers that an invitation is needed).
Why Deploy Zulip 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 Zulip 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 - no deployer fields, a contract block, and one script that proves the app is healthy, strangers cannot register, the generated owner login works and the API refuses writes without a key.
- Owner included - the first organization and its owner exist at first boot, so there is no creation link to generate inside the container.
- Data survives redeploys - messages in PostgreSQL on a volume, uploads and configuration on a volume, RabbitMQ and Redis on volumes.
- Pinned - Zulip, PostgreSQL, memcached, RabbitMQ and Redis are pinned by digest, and the wrapper by tag and digest.
Common Use Cases
- Team chat - threaded conversations organized by channel and topic, instead of a Slack subscription.
- Open-source community chat - a public-facing organization for contributors, with topic threads that stay readable.
- Coordination for AI agents - give an agent a generated login and an API key to post updates and read replies in a topic.
Dependencies for Zulip Hosting
- The zulip service, a PostgreSQL service, a memcached service, a RabbitMQ service and a Redis service, each with its volume where it stores data, created by the template.
Deployment Dependencies
Template Content
redis
redis:8.2.1-alpinedatabase
zulip/zulip-postgresql:14rabbitmq
rabbitmq:4.2memcached
memcached:alpine