---
title: "Deploy HedgeDoc"
description: "Real-time collaborative Markdown notes, slides and uploads"
category: "CMS"
url: https://railway.com/deploy/hedgedoc-2
---

# Deploy HedgeDoc

Real-time collaborative Markdown notes, slides and uploads

**[Deploy HedgeDoc on Railway](https://railway.com/template/hedgedoc-2)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/hedgedoc-2/manifest.json

- **Creator:** INAPP
- **Category:** CMS

## Template content

### hedgedoc

- **Source:** https://github.com/INAPP-Mobile/hedgedoc
- **Health check:** /
- **Public domain:** Yes

### postgres

- **Source:** https://github.com/INAPP-Mobile/hedgedoc

## Documentation

# Deploy and Host

[![Deploy on Railway](https://railway.app/button.svg)](https://railway.com/deploy/hedgedoc-2?utm_campaign=hedgedoc)

![HedgeDoc feature demonstration page](https://raw.githubusercontent.com/INAPP-Mobile/hedgedoc/main/assets/hedgedoc-features.png)

HedgeDoc is a real-time, collaborative Markdown editor — the self-hosted HackMD successor. Write notes together with live cursors, preview Markdown as you type, present any note as slides, and upload images. This template ships HedgeDoc 1.12.3 pinned by digest with a PostgreSQL companion, so the deploy form has one field: the session secret.

## About Hosting

One click deploys HedgeDoc with a PostgreSQL 16 companion. The first boot wires the database, derives the public URL from the live domain, and lands on the HedgeDoc landing page — register the first account in the UI and start writing. Notes default to private; per-note permissions are changeable in the UI. Railway's injected `PORT` is honored on every boot, and the public URL is derived from the live domain.

What gets deployed:

- **hedgedoc** — HedgeDoc 1.12.3 (Node 24) with an uploads volume at `/hedgedoc/public/uploads`
- **postgres** — PostgreSQL 16 companion with a persistent volume at `/var/lib/postgresql/data`
- **First account** — register in the UI (local auth, no email verification); the first account is the instance admin

## Why Deploy

- **Real collaboration:** multiple cursors on the same note, live preview, and slide mode for presenting.
- **Zero-fuss start:** no wizard — the database URL, public domain, and session secret are wired at boot.
- **Always-on by design:** notes, history, and uploads persist on Railway volumes.

## Common Use Cases

- Run a shared team notebook with live collaborative editing.
- Replace a shared docs folder with Markdown notes anyone on the team can edit and link.
- Keep meeting minutes as collaborative notes with slide mode for presenting.
- Host a public Markdown pad with per-note permissions.

## Dependencies for HedgeDoc Hosting

- The hedgedoc service with a volume at `/hedgedoc/public/uploads` and the postgres companion with a volume at `/var/lib/postgresql/data`, both created by the template. A custom domain is optional.

### Deployment Dependencies

| Setting | Value |
|---|---|
| Runtime | HedgeDoc 1.12.3 (Node 24) + PostgreSQL 16 |
| Plan | Hobby; two services |
| Port | Railway's injected `PORT`, honored on every boot via `CMD_PORT` (default 8080) |
| Persistence | Two Railway volumes: `/hedgedoc/public/uploads` (app) and `/var/lib/postgresql/data` (Postgres) |
| Healthcheck | `/` (unauthenticated landing page, 200 when the app is up) |

| Variable | Value | Notes |
|---|---|---|
| `HD_SESSION_SECRET` | _(generated)_ | Deploy-form field; session secret for logins |
| `POSTGRES_HOST` | _(auto-wired)_ | `${{postgres.RAILWAY_PRIVATE_DOMAIN}}` — private-network host of the companion |
| `POSTGRES_PASSWORD` | _(auto-wired)_ | `${{postgres.POSTGRES_PASSWORD}}` — generated password of the companion |
| `CMD_DEFAULT_PERMISSION` | `private` | Baked in the image; new notes are private by default (upstream default is `editable`) |
| `CMD_ALLOW_EMAIL_REGISTER` | `true` | Baked in the image; local registration open, no email verification step |
| `CMD_IMAGE_UPLOAD_TYPE` | `filesystem` | Baked in the image; uploads stored on the volume |
| `CMD_PORT` | _(injected by Railway)_ | Derived from `PORT` on every boot |
| `CMD_DOMAIN` | _(derived at boot)_ | Re-derived from `RAILWAY_PUBLIC_DOMAIN` on every boot |

Baked internals: `CMD_DB_URL` is composed at boot from `POSTGRES_HOST` + `POSTGRES_PASSWORD` (user `hedgedoc`, database `hedgedoc`, port `5432`); uploads at `/hedgedoc/public/uploads`; `CMD_SESSION_SECRET` is set from `HD_SESSION_SECRET`.


## Similar templates

- [Libredesk - Complete Setup](https://railway.com/deploy/libredesk-complete-setup) — Complete self-hosted omnichannel customer support desk.
- [Paperless-ngx](https://railway.com/deploy/paperless-ngx-3) — Paperless-ngx — document management with OCR and full-text search
- [Instatic CMS - Postgres](https://railway.com/deploy/instatic-cms-postgres) — Design, build and manage powerful static sites from state-of-the-art CMS

Open this page in a browser: https://railway.com/deploy/hedgedoc-2
