Introduction
HedgeDoc (formerly CodiMD) is a self-hosted platform for real-time collaborative document editing using Markdown. It provides a split-pane editor where multiple users can type simultaneously, seeing each other's changes in real time, similar to Google Docs but with Markdown and full data ownership.
What HedgeDoc Does
- Enables real-time simultaneous editing with cursor presence and conflict-free merging
- Renders Markdown with extended syntax including math (MathJax/KaTeX), diagrams (Mermaid), and code highlighting
- Supports slide mode that converts Markdown documents into reveal.js presentations
- Provides permission controls for notes: private, limited (link-only), or public
- Offers user authentication via local accounts, LDAP, OAuth2, SAML, and social logins
Architecture Overview
HedgeDoc 1.x is a Node.js application using Express for HTTP handling and Socket.IO for real-time synchronization. Collaborative editing uses Operational Transformation to merge concurrent changes. Data is stored in PostgreSQL, MySQL, MariaDB, or SQLite via Sequelize ORM. The editor uses CodeMirror for the editing pane and a custom Markdown renderer for the preview pane. Uploaded images can be stored locally, on S3, Azure Blob, or Imgur.
Self-Hosting & Configuration
- Deploy via Docker or install on Node.js 18+ with a supported database backend
- Configure the database connection via CMD_DB_URL environment variable or config.json
- Set up authentication providers (LDAP, OAuth2, SAML, GitHub, Google) in the configuration
- Configure image upload storage backend (local filesystem, S3, MinIO, or Imgur)
- Set default permissions and registration policies for your instance
Key Features
- Real-time collaborative editing with WebSocket-based synchronization and presence indicators
- Extended Markdown with embedded diagrams (Mermaid, PlantUML), math equations, and syntax highlighting for 100+ languages
- Slide mode converting documents into browser-based presentations via reveal.js
- Version history with revision browsing and the ability to revert to previous states
- Import and export in Markdown, HTML, and raw text formats
Comparison with Similar Tools
- Etherpad — real-time collaborative editor but plain text focused, not Markdown-native
- Outline — knowledge base with collaboration, but uses its own rich-text editor, not Markdown source
- Docmost — collaborative wiki with Markdown, newer and less mature
- Notion — commercial collaborative workspace, not self-hostable or open source
- Cryptpad — encrypted collaborative suite, trades ease of use for end-to-end encryption
FAQ
Q: Can I use HedgeDoc without creating an account? A: Yes, if the administrator enables anonymous editing. Guest users can create and edit notes without registration, depending on the instance's permission settings.
Q: Does HedgeDoc support version history? A: Yes. Each note maintains a revision history. Users can browse previous versions and restore earlier content through the revision panel.
Q: What happened to CodiMD? A: HedgeDoc was formerly known as CodiMD, which itself was a fork of HackMD. The project was renamed to HedgeDoc to establish an independent identity. HedgeDoc 2.x is a ground-up rewrite using React and a new real-time engine.
Q: Can I embed diagrams in documents? A: Yes. HedgeDoc supports Mermaid diagrams, PlantUML, GraphViz, Vega-Lite charts, and ABC music notation directly within Markdown using fenced code blocks.