Install SiYuan Inside Docker Container on Linux

Install SiYuan Inside Docker Container on Linux

SiYuan is an open-source, personal knowledge management (PKM) and note-taking tool. It supports a block-based editor with Markdown, bidirectional linking, a graph view, and end-to-end encryption and more.

This tutorial explains how to install SiYuan inside a Docker container on Linux. Commands have been tested on Ubuntu.

Prepare environment

Make sure you have installed Docker in your system. If you are using Ubuntu, installation instructions can be found in the post.

Install SiYuan

  • Host network

Run the following command to create a container for SiYuan that uses host network:

docker run -d --name=siyuan --restart=always --network=host \
    -v /opt/siyuan/workspace:/opt/siyuan/workspace \
    b3log/siyuan --workspace=/opt/siyuan/workspace --accessAuthCode=pwd123
  • User-defined bridge network

User-defined bridge network can be used for listening on different port. By default, SiYuan service is listening on port 6806. It can be changed with -p option.

docker network create app-net
docker run -d --name=siyuan --restart=always --network=app-net \
    -p 8080:6806 \
    -v /opt/siyuan/workspace:/opt/siyuan/workspace \
    b3log/siyuan --workspace=/opt/siyuan/workspace --accessAuthCode=pwd123

Note: don't forget to chage the authorization code used for logging into SiYuan workspace.

Testing SiYuan

Open a web browser and navigate to http://<IP_ADDRESS>:6806, replacing <IP_ADDRESS> with the system's actual IP address. Then, log in to the workspace using the authorization code.

SiYuan Inside Docker Container on Linux

Uninstall SiYuan

To completely remove SiYuan, remove its container:

docker rm --force siyuan

Remove SiYuan image:

docker rmi b3log/siyuan

You can also remove SiYuan data:

sudo rm -rf /opt/siyuan

If a user-defined bridge network was created, you can delete it as follows:

docker network rm app-net

Leave a Comment

Cancel reply

Your email address will not be published.