← All templates · Notes and wikis
Deploy HedgeDoc in one click
Markdown notes you write together in real time
A self-hosted alternative to HackMD.
What is HedgeDoc?
HedgeDoc is an open-source collaborative Markdown editor and an alternative to HackMD. Several people type into one note at once in the browser, with the rendered preview beside the text. The owner of a note sets who may read or edit it, in six levels from Freely to Private. Slide Mode turns a note into a reveal.js presentation, notes draw Mermaid and Graphviz diagrams and LaTeX math, and every change is kept as a revision you can go back to.
People self-host HedgeDoc to keep their notes on their own server, with no limit on accounts and nothing to pay. It suits friends, family or colleagues who write together, and it is light: the project says it runs smoothly even on a Raspberry Pi. The catch: version 1.x, the current release, is maintenance-only and takes no feature requests, while HedgeDoc 2, a full rewrite, has no release yet.
Hosting HedgeDoc on Pethost
- You sign in to Pethost with a passkey, GitHub or Google. No machine yet? You pick a plan, and the link waits until it is ready.
- New project opens at HedgeDoc. You fill in what it asks for and click Create project: Email, Password.
- In a minute or two HedgeDoc is live at its own address with HTTPS. Its secrets are made at random, and its data is in the nightly backup.
- It is a project like any other: you or your agent can change it, roll it back or restore it.
Questions about HedgeDoc
Is HedgeDoc free and open source?
Yes. HedgeDoc is free software under the GNU AGPL 3.0, with its source on GitHub. The license does not cover the HedgeDoc logo.
What is the difference between HedgeDoc, CodiMD and HackMD?
HedgeDoc began as CodiMD, the open-source edition split off from HackMD in 2017. HackMD stayed a commercial service at hackmd.io, and the community forked CodiMD in 2018 and renamed it HedgeDoc in 2020.
How do I export notes from HedgeDoc?
From a note's Menu, download it as Markdown, HTML or Raw HTML. Export user data, in the start page's user menu, zips every note you own as Markdown files. PDF export was removed; print to PDF from the browser.
Can I share a HedgeDoc note read-only?
Yes. Publish gives a read-only link to the note. Or set its permission to Locked: signed-in users and guests can read it, and only its owner can edit.
Can other people sign up on my HedgeDoc on Pethost?
Not until you allow it. The template makes one account from the email and password you enter and leaves registration closed. Adding CMD_ALLOW_EMAIL_REGISTER=true to .env and deploying again opens it.
How much memory and disk does HedgeDoc need?
HedgeDoc is light: about 250 MB with Postgres, and thousands of notes with their images take a few gigabytes. On Pethost the Starter plan is enough for it, with room for other apps beside it.
HedgeDoc Docker Compose file
The template is this compose.yaml and the variables written into the project’s .env as it is created. Pethost runs the file as it is written.
Containers: hedgedoc (quay.io/hedgedoc/hedgedoc:1.12.0), db (postgres:18-alpine).
Volumes, in the nightly backup: uploads, db.
services:
hedgedoc:
image: quay.io/hedgedoc/hedgedoc:1.12.0
restart: unless-stopped
environment:
CMD_DB_URL: postgres://hedgedoc:${POSTGRES_PASSWORD}@db:5432/hedgedoc
CMD_DOMAIN: ${HOST}
# TLS ends at the machine's proxy: links are https, with no port, and the proxy is trusted.
CMD_PROTOCOL_USESSL: "true"
CMD_URL_ADDPORT: "false"
CMD_SESSION_SECRET: ${SESSION_SECRET}
# A guest reads what a note's permission allows, and writes nothing.
CMD_ALLOW_ANONYMOUS: "false"
CMD_ALLOW_EMAIL_REGISTER: ${CMD_ALLOW_EMAIL_REGISTER:-false}
# Said outright, so that the image's entrypoint gives the uploads volume to its user.
CMD_IMAGE_UPLOAD_TYPE: filesystem
ACCOUNT_EMAIL: ${EMAIL}
ACCOUNT_PASSWORD: ${PASSWORD}
# The account comes from .env, so no sign-up page is left open, and every start sets its
# password again: HedgeDoc has no page to change it. The tables come first, as the app
# itself would make them.
command:
- sh
- -c
- |
set -e
node -e "require('./lib/models').runMigrations().then(() => process.exit(0))"
node bin/manage_users --reset="$$ACCOUNT_EMAIL" --pass="$$ACCOUNT_PASSWORD" ||
node bin/manage_users --add="$$ACCOUNT_EMAIL" --pass="$$ACCOUNT_PASSWORD"
exec node app.js
depends_on:
db:
condition: service_healthy
volumes:
- uploads:/hedgedoc/public/uploads
# The image's own check, with time for the first start's migrations.
healthcheck:
test: ["CMD", "node", "healthcheck.mjs"]
interval: 10s
timeout: 5s
retries: 5
start_period: 90s
db:
image: postgres:18-alpine
restart: unless-stopped
environment:
POSTGRES_DB: hedgedoc
POSTGRES_USER: hedgedoc
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- db:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -U hedgedoc -d hedgedoc"]
interval: 5s
timeout: 5s
retries: 12
start_period: 30s
volumes:
uploads:
db:
More in Notes and wikis
- MemosShort Markdown notes on a private timeline
- Obsidian LiveSyncA CouchDB server that syncs your Obsidian vaults with Self-hosted LiveSync
- BookStackA wiki organised as shelves, books, chapters and pages
- DocmostA collaborative wiki and docs, with spaces, real-time editing and diagrams
- EtherpadDocuments edited together in real time: each author in their own colour, with chat, history and plugins
- MediaWikiThe wiki software of Wikipedia: pages anyone can read, edited in the visual or the source editor