Deploy MrDoc

Team docs and knowledge base with AI Q&A and a token API

Deploy MrDoc

Just deployed

Deploy and Host MrDoc on Railway

MrDoc is an open-source online document system built on Python and Django for individuals and small teams. It manages documents, wikis, notes and a knowledge base with Markdown and rich-text editors, document collections with per-user permissions, full-text search, an AI question-answering knowledge base and a token-based API. The interface is primarily Chinese, with English and Traditional Chinese translations picked automatically from your browser language.

About Hosting MrDoc

This template runs MrDoc as a single service with one persistent volume:

  • MrDoc service from the official zmister/mrdoc:v9.7 image (Python runtime plus Chromium and LibreOffice for PDF export and attachment preview). The image ships the runtime only, so on first boot the start command downloads the pinned MrDoc source (MRDOC_VERSION) from GitHub and caches it on the volume.
  • Volume at /data holding the SQLite database, config.ini and secret.ini (/data/config), uploads (/data/media), site backups (/data/backup), the search index (/data/whoosh_index) and the cached source archive (/data/src).
  • Generated secrets: the Django MRDOC_SECRET_KEY and the admin password DJANGO_SUPERUSER_PASSWORD. The key that encrypts stored AI provider credentials is generated by MrDoc on first boot into /data/config/secret.ini.
  • Auth: an administrator account is created on first boot and open sign-up is switched off before the site starts serving, so nobody can register on your public URL.

After deploy:

  1. Open the Variables tab of the MrDoc service and copy DJANGO_SUPERUSER_PASSWORD. Sign in at https://YOUR-RAILWAY-DOMAIN/login/ with username admin (or the DJANGO_SUPERUSER_USERNAME you chose) and that password.
  2. Change the password from the user menu, then set the site name in the admin panel under Site Settings (https://YOUR-RAILWAY-DOMAIN/admin/setting/). Registration is already closed there; leave it closed unless you want public sign-up, or use invitation codes instead.
  3. Add team members in the admin panel under User Management.
  4. To use the AI knowledge base, add an OpenAI-compatible model provider and API key in the AI section of the admin panel. MrDoc runs fine without one.
  5. For API access, each user creates a personal token in their user center.
  6. If you add a custom domain, append it to MRDOC_CSRF_ORIGINS (comma separated, including https://) so logins work on that domain.

Common Use Cases

  • Internal team wiki and engineering documentation with per-collection permissions
  • Personal or team knowledge base with AI Q&A over your own documents
  • Product manuals and help centers, with export to PDF
  • Pushing notes and documents from scripts, editors or apps through the token API

Dependencies for MrDoc Hosting

  • Source: zmister2016/MrDoc (GPL-3.0)
  • Image: zmister/mrdoc:v9.7 on Docker Hub
  • No API keys are required. Optional: an OpenAI-compatible API key for AI Q&A and SMTP settings for password-reset email, both set in the admin panel.

Deployment Dependencies

Implementation Details

  • Upstream's Docker setup mounts a git checkout of the code into the image. Railway cannot mount a checkout, so the start command downloads the source archive for MRDOC_VERSION (a commit, tag or branch of zmister2016/MrDoc) and caches it on the volume. The default pins a master commit that includes the security fixes released after v1.1.1. To upgrade, set MRDOC_VERSION to a newer commit or tag and redeploy; when upstream publishes a new image tag, update the image as well.
  • Railway allows one volume per service, so config, media, backup and whoosh_index are symlinked into the single /data volume. Default files are copied in without overwriting your changes.
  • On every boot the start command runs migrations, creates the admin with createsuperuser --noinput (skipped if it already exists) and creates the "close registration" setting only if it is missing, so a later choice in the admin panel is kept.
  • MRDOC_CSRF_ORIGINS is written into config.ini on every boot because Railway terminates HTTPS at its proxy and Django must trust the public origin for logins.
  • uWSGI listens on PORT (10086) with 2 processes and 2 threads, logging to the Railway console; the healthcheck path is /.
  • The image is large (Chromium and LibreOffice, roughly 900 MB compressed), so the first deploy takes a few minutes. SQLite is used by default; MrDoc also supports MySQL and PostgreSQL through config.ini.
  • The container runs as root, as the upstream image expects.

Why Deploy MrDoc 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 MrDoc 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

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