Come hang with us on Discord and chat directly with the team!Discordtop-bar-close-icon

2024-08-29

How to Install HedgeDoc on Ubuntu Server

tutorials
img

Elevate your team's productivity with HedgeDoc, the ultimate real-time collaborative markdown editor. Follow our comprehensive guide to set up your own HedgeDoc instance on Ubuntu Server.

In the digital age, seamless collaboration is key to successful projects. HedgeDoc offers a secure, open-source platform for teams to create, edit, and share markdown documents in real-time. By hosting your own HedgeDoc server, you ensure data privacy while enjoying the benefits of collaborative editing.

Before we begin, make sure you have:

  • A server running the latest Ubuntu Server
  • Root access or sudo privileges
  • Basic command line knowledge

Step 1: Prepare Your System

Start by updating your system and installing necessary dependencies:

sudo apt update
sudo apt upgrade
sudo apt-get install git build-essential pkg-config curl
sudo apt-get install libssl-dev libffi-dev python3-dev

Step 2: Install Node.js

HedgeDoc requires Node.js. Install it using NVM (Node Version Manager):

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
source ~/.bashrc
nvm install node

Step 3: Set Up PostgreSQL

Install and configure PostgreSQL for HedgeDoc:

sudo apt-get install postgresql
sudo -u postgres psql

Once in the PostgreSQL prompt, create a user and database:

CREATE USER username WITH PASSWORD 'password';
CREATE DATABASE hedgedoc;
GRANT ALL PRIVILEGES ON DATABASE hedgedoc TO username;
\q

Step 4: Install HedgeDoc

Clone the HedgeDoc repository and install its dependencies:

git clone https://github.com/hedgedoc/hedgedoc.git
cd hedgedoc
npm install

Step 5: Configure HedgeDoc

Create and edit the configuration file:

cp .env.example .env
nano .env

Update the following lines in the .env file:

DB_TYPE=postgres
DB_HOST=localhost
DB_PORT=5432
DB_NAME=hedgedoc
DB_USERNAME=username
DB_PASSWORD=password

Step 6: Launch HedgeDoc

Build and start your HedgeDoc instance:

npm run build
npm start

Congratulations! Your HedgeDoc server is now up and running.

By following these steps, you've successfully set up a personal HedgeDoc instance. This powerful tool enables real-time collaboration on markdown documents, enhancing your team's productivity and creativity. Remember to configure SSL for added security, ensuring your collaborative efforts remain private and protected.

Embrace the future of collaborative editing with HedgeDoc, and transform the way your team works together!