Skip to content

2. Installation guide

Damien Cassu edited this page Jun 15, 2024 · 1 revision

Installation

The following instructions suppose your environment meets the requirements exposed in the previous section.

Authenticate to GitHub Packages npm registry

Important

Mermaid relies on modules hosted by GitHub Packages. Even if they are public and opensource, GitHub forces you to authenticate to its packages registry before being able to pull and install them. Thus use the following commands to authenticate to GitHub npm registry before going to installation steps

Connect to GitHub Packages using your own GitHub account:

npm login --scope=@damiencassu --auth-type=legacy --registry=https://npm.pkg.github.com

Note

You must use a GitHub classic access token with at least the scope package:read instead of your standard password Check GitHub documentation to get help if needed

Once the packages are installed (after you run npm install or after you built the docker image as explained in sections below) you are no longer required to stay connected to npm and can logout

npm logout --scope=@damiencassu

Bare metal install

Go to the directory you want to use to host Mermaid files and then download the latest version:

git clone https://github.com/damiencassu/mermaid.git ./

Install the node dependencies:

npm install

Start Mermaid

npm start

Dockerized install

Go to the directory you want to use to host Mermaid files and copy the Dockerfile and docker-compose.yml files.

Then, build the image (will only be done the first time) and run the container:

docker compose up -d