Deploy Coral Talk | (Just Updated) Disqus Alternative, Comment System With Admin Login Generated, Sign-Up Closed
Coral Talk self-hosted comment system, Disqus alternative, MongoDB, Redis
redis
Just deployed
/data
Just deployed
mongo
Just deployed
/data/db
Deploy and Host Coral Talk on Railway
Built for an LLM agent to deploy and use. The deploy form has no fields to fill: the admin login, the signing secret and the database and Redis passwords are generated, the server cannot start without them, and the admin account exists before the first request. Coral Talk is a self-hosted comment system for news sites and blogs, an open-source alternative to Disqus with threaded comments, a moderation queue, user and story management, an embeddable comment stream and a GraphQL API.
About Hosting Coral Talk
This template runs three services: coral, the upstream Coral Talk image (v9.11.9) pinned by digest through a thin wrapper, mongo, a MongoDB 8.0 database with a volume at /data/db that holds comments, users and the tenant, and redis, a Redis 8 instance with a volume at /data that holds the cache, rate limits and job queues. Coral keeps nothing on its own disk, so the coral service has no volume. One public domain serves the comment stream, the admin at /admin and the GraphQL API. The server listens on Railway's injected PORT, and the healthcheck is GET /api/health.
What the wrapper fixes. Upstream has no first account until someone opens the /install page in a browser, and that page is public until it is used: whoever reaches a fresh deploy first becomes the owner. Every setting (MongoDB and Redis addresses, signing secret) is also a variable to type. The wrapper bakes the fixed settings into the image so the deploy form is empty, starts the server on a loopback port, installs the tenant and the admin account from ADMIN_EMAIL and ADMIN_PASSWORD, closes public registration through the settings API, and only then starts the real server on PORT, so the install page is never reachable from outside. It refuses to start without a strong admin password and signing secret, and a restart leaves the existing account and settings unchanged. It also patches the sign-up handler to answer 403 where upstream answers HTTP 500 for a closed registration. Read from the upstream source and checked on a Railway deploy: sign-up answers 403, a second install answers TENANT_INSTALLED_ALREADY, the generated login signs in. Not reproduced on a Railway control of an incumbent listing.
Using it. Open the domain's /admin and sign in with ADMIN_EMAIL and ADMIN_PASSWORD, then add your site's origin under Configure > General and embed the comment stream script on your pages. Everything is stored in MongoDB, so redeploys keep it.
Agent contract
- Public URL:
https://RAILWAY_PUBLIC_DOMAIN(the generated domain of thecoralservice) - Private URL:
http://coral.railway.internal:8080 - Credentials: the variables
ADMIN_EMAILandADMIN_PASSWORDon thecoralservice (plain text;ADMIN_EMAILisadmin@plus the public domain) - Auth:
POST /api/auth/localwith{"email","password"}returns{"token":"JWT"}; send it asAuthorization: Bearer JWTto the GraphQL API atPOST /api/graphqlwithContent-Type: application/json. A wrong password answers401; a GraphQL call without a token answers HTTP 400RAW_QUERY_NOT_AUTHORIZED. - Health:
GET /api/healthreturns 200OKwithout credentials
#!/bin/sh
# needs: RAILWAY_PUBLIC_DOMAIN, ADMIN_EMAIL, ADMIN_PASSWORD (variables of the coral service); also curl, grep, sed.
R="https://$RAILWAY_PUBLIC_DOMAIN"; J="content-type: application/json"
n=0; until [ "$(curl -s -o /dev/null -w '%{http_code}' "$R/api/health")" = 200 ]; do n=$((n+1)); [ "$n" -le 60 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/api/health"
# Coral logs in over REST (POST /api/auth/local returns a JWT) and serves GraphQL at POST /api/graphql with Authorization: Bearer.
# a wrong password does not sign in
curl -s -o /dev/null -w "wrong password: %{http_code}\n" -H "$J" -d '{"email":"'"$ADMIN_EMAIL"'","password":"not-the-admin-secret"}' "$R/api/auth/local"
# the generated login returns a token
T=$(curl -s -H "$J" -d '{"email":"'"$ADMIN_EMAIL"'","password":"'"$ADMIN_PASSWORD"'"}' "$R/api/auth/local" | sed -n 's/.*"token":"\([^"]*\)".*/\1/p')
echo "login: $(echo "$T" | cut -c1-3)"
gql() { curl -s -H "$J" -H "Authorization: Bearer $T" -d "$1" "$R/api/graphql"; }
echo "signed in as: $(gql '{"query":"query{viewer{email role}}"}' | grep -o '"role":"[A-Z]*"')"
# write-auth: a write (rename the organization) with the token succeeds, the same write without it is refused
echo "write with token: $(gql '{"query":"mutation{updateSettings(input:{settings:{organization:{name:\"Agent Org\"}},clientMutationId:\"a\"}){settings{organization{name}}}}"}' | grep -o '"name":"Agent Org"')"
echo "write without key: $(curl -s -H "$J" -d '{"query":"mutation{updateSettings(input:{settings:{organization:{name:\"Anon\"}},clientMutationId:\"a\"}){clientMutationId}}"}' "$R/api/graphql" | grep -oiE 'NOT_AUTHORIZED|UNAUTHORIZED')"
# public signup: a stranger's registration is refused with 403
curl -s -o /dev/null -w "public signup: %{http_code}\n" -H "$J" -d '{"username":"stranger","email":"stranger@example.org","password":"Stranger-Pass-Abcdef"}' "$R/api/auth/local/signup"
Expected output against a fresh deploy (measured on the Railway demo; the control-deploy output of the published code is recorded in template.md):
health: 200
wrong password: 401
login: eyJ
signed in as: "role":"ADMIN"
write with token: "name":"Agent Org"
write without key: NOT_AUTHORIZED
public signup: 403
The refusals are the contract: a wrong password answers 401 (wrong password: 401), a GraphQL write without the token answers NOT_AUTHORIZED (write without key: NOT_AUTHORIZED, HTTP 400 with the refusal in the body), and a stranger's sign-up answers 403 (public signup: 403).
Why Deploy Coral Talk 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 Coral Talk 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 server is healthy, a wrong password and a stranger do not get in, and the generated login does.
- Locked from the first request - the install page is used before the server is public, registration is closed, and the server will not start without strong secrets.
- Data survives redeploys - comments and users live in MongoDB on a volume, the cache and queues in Redis on a volume.
- Works on first deploy - the listener follows Railway's injected
PORTand the databases are reached over the private network. - Pinned - the upstream image is pinned by digest and the wrapper by tag and digest.
Common Use Cases
- Comments on a blog or news site - embed a moderated comment stream and keep the data on your own domain.
- A Disqus replacement - threaded replies, reactions, user bans and a moderation queue without ads or tracking.
- Community moderation for several sites - one install serves multiple sites and stories, managed from one admin.
Dependencies for Coral Talk Hosting
- The coral service, a MongoDB service and a Redis service, the two databases each with their volume, created by the template.
Deployment Dependencies
Template Content
