Deploy Docmost | (Just Updated) Wiki, Confluence Alternative With Admin Login Generated, Real-Time Collaboration

Docmost self-hosted wiki, Confluence and Notion alternative, Postgres

Deploy Docmost | (Just Updated) Wiki, Confluence Alternative With Admin Login Generated, Real-Time Collaboration

Just deployed

/app/data/storage

Just deployed

/var/lib/postgresql

Just deployed

/data

Deploy and Host Docmost on Railway

Built for an LLM agent to deploy and use. The deploy form has no fields to fill: the administrator login and the database and Redis passwords are generated, the server cannot start without them, and the first workspace and its administrator exist before the first request, so nobody can claim the instance through the open setup page. Docmost is a self-hosted collaborative wiki and documentation platform, an open-source alternative to Confluence and Notion with real-time editing, spaces, page history, comments, diagrams and full-text search.

About Hosting Docmost

This template runs three services: docmost, the official Docmost image (0.97.0) pinned by digest through a thin wrapper, with a volume at /app/data/storage that holds page attachments and uploads; database, a PostgreSQL 18 instance with a volume at /var/lib/postgresql that holds workspaces, spaces, pages, users and search indexes; and cache, a Redis 8 instance with a volume at /data that holds the websocket state and the job queue. One public domain serves the web interface and the API under /api/. The server listens on Railway's injected PORT (8080), and GET /api/health answers 200 once Postgres and Redis are reachable.

What the wrapper fixes. Docmost runs its database migrations only when NODE_ENV=production, which the wrapper sets, and it creates the first workspace through a one-time /api/auth/setup call that is open to whoever reaches a fresh instance first. The wrapper makes that call itself at boot with the generated ADMIN_EMAIL and ADMIN_PASSWORD, so the setup page is closed (it answers 403) before the public domain is shared. Railway mounts volumes owned by root, so the wrapper hands the storage volume to uid 1000 and then drops to that user. It builds the database and Redis connection strings from the service variables, and refuses to start without a password of at least 12 characters, a 32-character app secret, and database and Redis credentials. Checked on a Railway deploy: the generated login signs in, a write without it answers 401, and the setup call from a stranger answers 403. Not reproduced on a Railway control of an incumbent listing.

Using it. Open the domain and sign in with ADMIN_EMAIL and ADMIN_PASSWORD. Create a space, invite teammates from the workspace settings, and start writing; everything is stored in PostgreSQL and the storage volume, so redeploys keep it.

Agent contract

  • Public URL: https://RAILWAY_PUBLIC_DOMAIN (the generated domain of the docmost service)
  • Private URL: http://docmost.railway.internal:8080
  • Credentials: the variables ADMIN_EMAIL and ADMIN_PASSWORD on the docmost service (plain text; ADMIN_EMAIL is admin@ plus the public domain)
  • Auth: POST /api/auth/login with a JSON body {"email","password"} returns an authToken cookie; send that cookie on every other /api/ call
  • Health: GET /api/health returns 200 without credentials
#!/bin/sh
# needs: RAILWAY_PUBLIC_DOMAIN, ADMIN_EMAIL, ADMIN_PASSWORD (variables of the docmost service); also curl.
R="https://$RAILWAY_PUBLIC_DOMAIN"; J=$(mktemp); H="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 90 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/api/health"
# the workspace and admin are created at boot; login sets the authToken cookie that every other /api call carries
curl -s -c "$J" -H "$H" -d '{"email":"'"$ADMIN_EMAIL"'","password":"'"$ADMIN_PASSWORD"'"}' -o /dev/null -w "login: %{http_code}\n" "$R/api/auth/login"
# write-auth: creating a space with the cookie succeeds, the same call with no credential is refused
curl -s -b "$J" -H "$H" -d '{"name":"Agent check '$$'","slug":"agent'$$'"}' -o /dev/null -w "write with cookie: %{http_code}\n" "$R/api/spaces/create"
curl -s -H "$H" -d '{"name":"Anon","slug":"anon"}' -o /dev/null -w "write without key: %{http_code}\n" "$R/api/spaces/create"
# signup: the one-time setup call that would make a stranger the owner is refused because the workspace exists
curl -s -H "$H" -d '{"name":"Stranger","email":"stranger@example.org","password":"Str4ngerPass123","workspaceName":"x"}' -o /dev/null -w "public signup: %{http_code}\n" "$R/api/auth/setup"

Expected output against a fresh deploy (measured on the Railway demo; the output is recorded in template.md):

health: 200
login: 200
write with cookie: 200
write without key: 401
public signup: 403

The refusals are the contract: a write without the cookie answers 401 (write without key: 401), and the one-time setup call from a stranger answers 403 (public signup: 403) because the workspace already exists.

Why Deploy Docmost 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 Docmost 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 stranger is refused, and the generated login can write through the API.
  • Locked from the first request - the workspace and administrator are created at boot, so the open setup page never serves a visitor, and the server will not start without strong secrets.
  • Data survives redeploys - pages in PostgreSQL on a volume, the job queue in Redis on a volume, attachments on a volume.
  • Migrations run - the wrapper sets the production mode that Docmost needs to migrate its schema on boot.
  • Pinned - the upstream image is pinned by digest and the wrapper by tag and digest.

Common Use Cases

  • Team wiki and knowledge base - keep runbooks, onboarding guides and decisions in spaces with page history.
  • Product and engineering documentation - write specs together in real time, with diagrams and comments.
  • A private Confluence or Notion replacement - keep pages and attachments on infrastructure you control.

Dependencies for Docmost Hosting

  • The docmost service, a PostgreSQL service and a Redis service, each with its volume, created by the template.

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
Self-hosted virtual tabletop for role-playing games (license required)

Lucas
71
View Template
NEW
Double Commander in your browser
The Double Commander file manager in the cloud, from any device

Nermin Sabanovic
0