
Deploy 0docs
A Mintlify-grade documentation platform you can self-host for free.
Just deployed
/var/lib/postgresql/data
0docs
Just deployed
Deploy and Host 0docs on Railway
0docs is an open-source documentation platform with a block-based editor (code, callouts, tabs, cards, API endpoints), a themable design system, branch-based drafts, atomic version publishing, an AI "Ask docs" assistant, and a built-in MCP server so AI agents like Claude Desktop and Cursor can read and edit your docs.
About Hosting 0docs
0docs deploys as a single Node service that serves both the API at /api/* and the built React frontend at /. Railway provisions PostgreSQL automatically; the app picks up $PORT, runs idempotent migrations on every boot, and auto-generates its session-signing secret into Postgres on first start. Sessions, the signing secret, and uploaded media all live in the database so nothing depends on the ephemeral container filesystem. Optional S3-compatible storage can be toggled on later via env vars when you outgrow inline BLOBs. The /api/healthz endpoint verifies successful boots; the first user to sign up becomes the admin, after which the in-app Team page handles further invites.
Common Use Cases
- Public product or API documentation site for a SaaS or open-source project, with a custom domain and Mintlify-style layout.
- Internal knowledge base for an engineering or product team — disable public signup (
DISABLE_SIGNUP=true) and onboard members through the admin invite flow. - AI-readable knowledge surface via the bundled MCP server, so Claude, Cursor, Continue, and other clients can query and update docs programmatically.
Dependencies for 0docs Hosting
- PostgreSQL 14+ — provisioned automatically by Railway's PostgreSQL plugin;
DATABASE_URLis injected into the app service. - Node.js 24 — baked into the Docker image; you don't manage the runtime.
- Optional: an SMTP relay for real password-reset and invite emails. Without it, links are printed to Railway logs so admins can copy and share them.
- Optional: an OpenAI-compatible API key to power the "Ask docs" assistant.
- Optional: an S3-compatible bucket (AWS S3, Cloudflare R2, Backblaze B2, MinIO) for offloading uploaded media. Default storage is Postgres BLOBs — zero infra setup.
Deployment Dependencies
- GitHub repository — source of truth, MIT licensed.
- Self-hosting guide (
SELFHOSTING.md) — reverse-proxy recipes, backup strategy, SMTP setup, S3 migration. - MCP server documentation — tool catalog and auth modes for AI-agent access.
Implementation Details
The template wires two services into one project:
- app — built from the repo's
Dockerfile. Multi-stage build that bundles the api-server with esbuild and the React frontend with Vite, then copies the staticdist/next to the api bundle. One process, one port. - Postgres plugin — provides
DATABASE_URL, referenced by the app as${{Postgres.DATABASE_URL}}.
Variables the template prompts for at deploy time (all optional):
| Variable | Effect when set | When unset |
|---|---|---|
ADMIN_EMAIL + ADMIN_PASSWORD | Seeds an admin user on first boot. | First UI signup becomes admin. |
OPENAI_API_KEY | Enables the "Ask docs" AI button. | AI button shows a friendly "not configured" message. |
SMTP_URL + SMTP_FROM | Sends real password-reset and invite emails. | Links printed to Railway logs. |
STORAGE_BACKEND=s3 + S3_* | Uploaded media goes to object storage. | Media stored as Postgres BLOBs. |
DISABLE_SIGNUP=true | Locks down /auth/signup; only admin invites can onboard new users. | Public signup remains open. |
Baked-in defaults:
NODE_ENV=production— sets theSecureflag on session cookies and tightens CORS.DATABASE_URL— kept as a reference to the bundled Postgres plugin.
The app generates its own SESSION_SECRET on first boot and persists it in a system_settings table, so there is no secret to manage by hand.
Why Deploy 0docs 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 0docs 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.
Template Content