HedgeDoc Collaborative Markdown
HedgeDoc for collaborative markdown editing with PostgreSQL.
Overview
HedgeDoc is a modern, open-source collaborative markdown editor that evolved from HackMD, designed to enable real-time collaborative document creation and editing. It transforms markdown editing from a solitary activity into a dynamic team experience, supporting simultaneous editing by multiple users with live cursor tracking, change highlighting, and instant synchronization. HedgeDoc excels at technical documentation, meeting notes, project planning, and any scenario where teams need to collaborate on structured text content in real-time. This stack combines HedgeDoc with PostgreSQL to create a robust, production-ready collaborative writing platform. PostgreSQL provides enterprise-grade data integrity and ACID compliance for storing document content, revision history, and user data - crucial for collaborative environments where document consistency and data reliability are paramount. The relational structure of PostgreSQL efficiently handles HedgeDoc's complex relationships between users, documents, permissions, and collaborative sessions, while its advanced indexing capabilities ensure fast document retrieval even with large document repositories. This combination serves development teams, technical writers, educators, and organizations that need reliable collaborative documentation tools with professional-grade data persistence. The PostgreSQL backend ensures that collaborative sessions remain consistent even under heavy concurrent editing loads, while HedgeDoc's real-time synchronization engine provides the responsive editing experience users expect from modern collaborative platforms.
Key Features
- Real-time collaborative editing with live cursor tracking and user presence indicators
- Comprehensive markdown support including tables, code blocks, math equations, and diagrams
- Built-in presentation mode for converting markdown documents into slideshow presentations
- Document permission system with view, edit, and share controls for team collaboration
- PostgreSQL-backed revision history with full document versioning and change tracking
- Anonymous editing support for public collaboration without account requirements
- File upload system with persistent storage for images and attachments
- Multi-user concurrent editing with conflict resolution and operational transformation
Common Use Cases
- 1Software development teams creating and maintaining technical documentation collaboratively
- 2Educational institutions enabling students and faculty to work together on research papers and course materials
- 3Remote teams conducting real-time meeting notes and project planning sessions
- 4Open source projects managing community-driven documentation and contribution guidelines
- 5Technical writing teams creating API documentation, user guides, and knowledge bases
- 6Startups and small businesses maintaining internal wikis and process documentation
- 7Conference organizers collaborating on speaker notes, schedules, and presentation materials
Prerequisites
- Docker and Docker Compose installed with at least 2GB available RAM for optimal performance
- Port 3000 available for HedgeDoc web interface access
- Basic understanding of markdown syntax for effective document creation
- Network access configuration if deploying for team access beyond localhost
- SSL certificate and reverse proxy setup for production deployments with external access
- Backup strategy for PostgreSQL data volume to prevent document loss
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 postgres: 3 image: postgres:16-alpine4 container_name: hedgedoc-postgres5 restart: unless-stopped6 environment: 7 POSTGRES_USER: ${POSTGRES_USER:-hedgedoc}8 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-hedgedoc}9 POSTGRES_DB: ${POSTGRES_DB:-hedgedoc}10 volumes: 11 - postgres_data:/var/lib/postgresql/data12 networks: 13 - hedgedoc-network1415 hedgedoc: 16 image: quay.io/hedgedoc/hedgedoc:latest17 container_name: hedgedoc18 restart: unless-stopped19 ports: 20 - "${HEDGEDOC_PORT:-3000}:3000"21 environment: 22 - CMD_DB_URL=postgres://${POSTGRES_USER:-hedgedoc}:${POSTGRES_PASSWORD:-hedgedoc}@postgres:5432/${POSTGRES_DB:-hedgedoc}23 - CMD_DOMAIN=${DOMAIN:-localhost}24 - CMD_URL_ADDPORT=${ADD_PORT:-true}25 - CMD_PROTOCOL_USESSL=false26 - CMD_ALLOW_ANONYMOUS=${ALLOW_ANON:-true}27 - CMD_ALLOW_ANONYMOUS_EDITS=${ALLOW_ANON_EDIT:-true}28 volumes: 29 - hedgedoc_uploads:/hedgedoc/public/uploads30 depends_on: 31 - postgres32 networks: 33 - hedgedoc-network3435volumes: 36 postgres_data: 37 hedgedoc_uploads: 3839networks: 40 hedgedoc-network: 41 driver: bridge.env Template
.env
1# HedgeDoc2HEDGEDOC_PORT=30003DOMAIN=localhost4ADD_PORT=true5POSTGRES_USER=hedgedoc6POSTGRES_PASSWORD=hedgedoc7POSTGRES_DB=hedgedoc8ALLOW_ANON=true9ALLOW_ANON_EDIT=trueUsage Notes
- 1HedgeDoc at http://localhost:3000
- 2Create notes with /new
- 3Real-time collaboration
- 4Supports presentations
Individual Services(2 services)
Copy individual services to mix and match with your existing compose files.
postgres
postgres:
image: postgres:16-alpine
container_name: hedgedoc-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-hedgedoc}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-hedgedoc}
POSTGRES_DB: ${POSTGRES_DB:-hedgedoc}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- hedgedoc-network
hedgedoc
hedgedoc:
image: quay.io/hedgedoc/hedgedoc:latest
container_name: hedgedoc
restart: unless-stopped
ports:
- ${HEDGEDOC_PORT:-3000}:3000
environment:
- CMD_DB_URL=postgres://${POSTGRES_USER:-hedgedoc}:${POSTGRES_PASSWORD:-hedgedoc}@postgres:5432/${POSTGRES_DB:-hedgedoc}
- CMD_DOMAIN=${DOMAIN:-localhost}
- CMD_URL_ADDPORT=${ADD_PORT:-true}
- CMD_PROTOCOL_USESSL=false
- CMD_ALLOW_ANONYMOUS=${ALLOW_ANON:-true}
- CMD_ALLOW_ANONYMOUS_EDITS=${ALLOW_ANON_EDIT:-true}
volumes:
- hedgedoc_uploads:/hedgedoc/public/uploads
depends_on:
- postgres
networks:
- hedgedoc-network
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 postgres:5 image: postgres:16-alpine6 container_name: hedgedoc-postgres7 restart: unless-stopped8 environment:9 POSTGRES_USER: ${POSTGRES_USER:-hedgedoc}10 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-hedgedoc}11 POSTGRES_DB: ${POSTGRES_DB:-hedgedoc}12 volumes:13 - postgres_data:/var/lib/postgresql/data14 networks:15 - hedgedoc-network1617 hedgedoc:18 image: quay.io/hedgedoc/hedgedoc:latest19 container_name: hedgedoc20 restart: unless-stopped21 ports:22 - "${HEDGEDOC_PORT:-3000}:3000"23 environment:24 - CMD_DB_URL=postgres://${POSTGRES_USER:-hedgedoc}:${POSTGRES_PASSWORD:-hedgedoc}@postgres:5432/${POSTGRES_DB:-hedgedoc}25 - CMD_DOMAIN=${DOMAIN:-localhost}26 - CMD_URL_ADDPORT=${ADD_PORT:-true}27 - CMD_PROTOCOL_USESSL=false28 - CMD_ALLOW_ANONYMOUS=${ALLOW_ANON:-true}29 - CMD_ALLOW_ANONYMOUS_EDITS=${ALLOW_ANON_EDIT:-true}30 volumes:31 - hedgedoc_uploads:/hedgedoc/public/uploads32 depends_on:33 - postgres34 networks:35 - hedgedoc-network3637volumes:38 postgres_data:39 hedgedoc_uploads:4041networks:42 hedgedoc-network:43 driver: bridge44EOF4546# 2. Create the .env file47cat > .env << 'EOF'48# HedgeDoc49HEDGEDOC_PORT=300050DOMAIN=localhost51ADD_PORT=true52POSTGRES_USER=hedgedoc53POSTGRES_PASSWORD=hedgedoc54POSTGRES_DB=hedgedoc55ALLOW_ANON=true56ALLOW_ANON_EDIT=true57EOF5859# 3. Start the services60docker compose up -d6162# 4. View logs63docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/hedgedoc-markdown/run | bashTroubleshooting
- HedgeDoc shows database connection errors: Verify PostgreSQL container is running and environment variables match between services
- Real-time collaboration not working properly: Check that WebSocket connections aren't blocked by firewall or proxy settings
- File uploads failing or images not displaying: Ensure hedgedoc_uploads volume has proper write permissions and sufficient disk space
- Anonymous editing disabled unexpectedly: Verify CMD_ALLOW_ANONYMOUS and CMD_ALLOW_ANONYMOUS_EDITS environment variables are set to true
- PostgreSQL container fails to start with data corruption: Stop containers, remove postgres_data volume, and restart to reinitialize database
- HedgeDoc performance degrading with many concurrent users: Increase PostgreSQL shared_buffers and work_mem settings, monitor connection pool limits
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Components
hedgedocpostgresql
Tags
#hedgedoc#markdown#collaboration#notes#real-time
Category
Productivity & CollaborationAd Space
Shortcuts: C CopyF FavoriteD Download