Access HedgeDoc
- Open the HedgeDoc web interface:
https://<SERVER-IP> - A browser warning will appear because a self-signed certificate is being used. Proceed to the site to continue.
- Click 'Sign In' then 'Register' to create your account.
Endpoints
- Main Application:
https://<SERVER-IP>/(web interface) - Status:
https://<SERVER-IP>/status(health check page) - Metrics:
https://<SERVER-IP>/metrics(system metrics) - WebSocket:
/socket.io/(real-time communication)
Registration
User registration is enabled by default.
To disable new user registration, change CMD_ALLOW_EMAIL_REGISTER=true to CMD_ALLOW_EMAIL_REGISTER=false in /root/hedgedoc/.env.
Restart the application to apply the change:
cd /root/hedgedoc
docker compose restart
Database Backup
Create a PostgreSQL backup:
cd /root/hedgedoc
docker compose exec database pg_dump hedgedoc -U hedgedoc > backup.sql
Important Files & Directories
- Install Path:
/root/hedgedoc - Compose File:
/root/hedgedoc/docker-compose.yml - Environment File:
/root/hedgedoc/.env - Nginx Config:
/etc/nginx/sites-available/hedgedoc - SSL Certificate:
/etc/nginx/ssl/hedgedoc.crt - SSL Key:
/etc/nginx/ssl/hedgedoc.key - Uploads Volume:
/var/lib/docker/volumes/hedgedoc_uploads/_data - Database Volume:
/var/lib/docker/volumes/hedgedoc_database/_data
Docker Management
Check containers:
docker ps
View logs:
cd /root/hedgedoc
docker compose logs -f
Restart services:
cd /root/hedgedoc
docker compose restart
Stop services:
cd /root/hedgedoc
docker compose down
Start services:
cd /root/hedgedoc
docker compose up -d
NGINX Management
Test configuration:
nginx -t
Restart NGINX:
systemctl restart nginx
Reload NGINX:
systemctl reload nginx
Check NGINX status:
systemctl status nginx
Enabling SSL with a Domain
1. Point your domain to the server IP.
2. Edit Nginx config and replace both server_name _; with your domain (server_name <yourdomain.com>) for both HTTP (port 80) and HTTPS (port 443) blocks:
vim /etc/nginx/sites-available/hedgedoc
3. Install Certbot:
apt install -y certbot python3-certbot-nginx
4. Run the following command to generate a valid Let's Encrypt certificate:
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
5. Replace SSL paths in Nginx config:
vim /etc/nginx/sites-available/hedgedoc
# Before:
# ssl_certificate /etc/nginx/ssl/hedgedoc.crt;
# ssl_certificate_key /etc/nginx/ssl/hedgedoc.key;
# After:
# ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
6. Reload Nginx to apply the changes:
systemctl reload nginx
7. Edit the /root/hedgedoc/.env file to set your domain name: CMD_DOMAIN=yourdoamin.com
8. Recreate the services:
cd /root/hedgedoc
docker compose up -d
9. Open your browser and visit: https://yourdomain.com