Deploy CodeX Docs | (Just Updated) Documentation Site and Wiki with Editor.js and REST API, Password Set at Boot, Data Survives Redeploys

CodeX Docs documentation site and wiki with Editor.js and REST API

Deploy CodeX Docs | (Just Updated) Documentation Site and Wiki with Editor.js and REST API, Password Set at Boot, Data Survives Redeploys

Just deployed

/data

Deploy and Host CodeX Docs on Railway

Built for an LLM agent to deploy and use. The deploy form has no fields to fill: the editor password and the session secret are generated for you. CodeX Docs is an open-source documentation and wiki engine from the CodeX team. Pages are written in the Editor.js block editor, organised as a tree, and served as a clean public docs site with search, a sidebar and a table of contents, plus a JSON API for automation.

This template runs the official CodeX Docs image through a small wrapper (needed because upstream reads its settings only from YAML files), pinned by digest, with a volume on /data so pages and uploads survive redeploys. People use it as a self-hosted alternative to paid documentation hosting for product docs, team wikis and knowledge bases.

About Hosting CodeX Docs

CodeX Docs is a single Node.js server that renders the public documentation and serves the editor and the API on one port. Upstream has no environment-variable configuration, so the wrapper writes docs-config.yaml at boot from two variables, DOCS_PASSWORD and DOCS_SECRET, both generated as Railway secrets at deploy time. Reading the docs needs no login. Anything that changes content needs the password: a browser signs in at /auth, which sets an authToken cookie, and every write call carries that cookie. The wrapper also makes the API answer 401 to a request without a valid cookie (upstream redirects to the login page instead).

State lives under /data on a Railway volume: the file database and uploaded images. Redeploys keep the same password, the same secret and the same pages. The first block of every page body must be a header block, which is how the editor starts a page and what the API enforces. Optional variables: SITE_TITLE (default CodeX Docs) sets the site title.

Agent contract

  • Public URL: https://RAILWAY_PUBLIC_DOMAIN (the generated domain of the codex-docs service)
  • Private URL: http://codex-docs.railway.internal:8080
  • Credentials: the variables DOCS_PASSWORD and DOCS_SECRET, set on the codex-docs service (DOCS_SECRET signs the session token and is never sent by a client)
  • Auth: sign in once with POST /auth (form fields password and _csrf, the token read from the /auth page) and send the returned authToken cookie on every write; reads of published pages are public
  • Health: GET / returns 200 without credentials
# needs: SITE_URL (public https URL of the codex-docs service) and DOCS_PASSWORD (its variable)
JAR=$(mktemp)
curl -s -o /dev/null -w "health: %{http_code}\n" "$SITE_URL/"
curl -s -o /dev/null -w "read without key: %{http_code}\n" "$SITE_URL/api/pages"
curl -s -o /dev/null -w "write without key: %{http_code}\n" -X PUT -H 'content-type: application/json' -d '{"title":"agent-check","body":{"blocks":[{"type":"header","data":{"text":"agent-check","level":2}}]},"parent":"0","uri":"agent-check"}' "$SITE_URL/api/page"
curl -s -o /dev/null -w "write wrong key: %{http_code}\n" -X PUT -H 'content-type: application/json' -H 'Cookie: authToken=wrong' -d '{"title":"agent-check","body":{"blocks":[{"type":"header","data":{"text":"agent-check","level":2}}]},"parent":"0","uri":"agent-check"}' "$SITE_URL/api/page"
CSRF=$(curl -s -c "$JAR" "$SITE_URL/auth" | grep -o 'name="_csrf" value="*[A-Za-z0-9_-]*' | sed 's/.*value="*//' | head -1)
curl -s -o /dev/null -w "login: %{http_code}\n" -b "$JAR" -c "$JAR" --data-urlencode "password=$DOCS_PASSWORD" --data-urlencode "_csrf=$CSRF" "$SITE_URL/auth"
curl -s -o /dev/null -w "write with key: %{http_code}\n" -b "$JAR" -X PUT -H 'content-type: application/json' -d '{"title":"agent-check","body":{"blocks":[{"type":"header","data":{"text":"agent-check","level":2}}]},"parent":"0","uri":"agent-check"}' "$SITE_URL/api/page"
curl -s -b "$JAR" "$SITE_URL/api/pages" | head -c 300; echo
curl -s -o /dev/null -w "published page: %{http_code}\n" "$SITE_URL/agent-check"
rm -f "$JAR"

A fresh deploy prints health: 200, read without key: 401, write without key: 401, write wrong key: 401, login: 302, write with key: 200, a JSON object whose result lists the agent-check page, and published page: 200.

Why Deploy CodeX Docs 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 CodeX Docs 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 read, write and refusal.
  • Locked by default - a generated DOCS_PASSWORD protects editing and the whole write API; unauthenticated writes answer 401.
  • Data survives redeploys - a volume on /data keeps pages and uploads, and the password stays stable.
  • Light - one Node.js container, measured about 64 MiB idle.
  • Health-checked - Railway restarts the service if the home page stops answering.

Common Use Cases

  • Product documentation - a branded public docs site your team edits in a block editor.
  • Team wiki and knowledge base - a page tree with search, written by people or by an agent over the API.
  • Developer handbooks and runbooks - versionless, fast pages with code blocks and a table of contents.
  • Agent-written docs - let a coding agent publish and update pages over the JSON API.

Dependencies for CodeX Docs Hosting

  • None. A custom domain is optional.

Deployment Dependencies


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
51
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
52