SiYuan — Self-Hosted, Open-Source

A privacy-first personal knowledge management software, written in typescript and golang.

License: AGPL-3.0. Built with: TypeScript, Go, JavaScript, SCSS, HTML, Python, CSS, Shell, Go Template, Batchfile, NSIS, Lua, Dockerfile. Website: https://b3log.org/siyuan/. Source: https://github.com/siyuan-note/siyuan.

Features

Installation

* `PUID`: Custom user ID (optional, defaults to `1000` if not provided) * `PGID`: Custom group ID (optional, defaults to `1000` if not provided) * `workspace_dir_host`: The workspace folder path on the host * `workspace_dir_container`: The path of the workspace folder in the container, as specified in `--workspace` * In alternative, it's possible to set the path via the `SIYUAN_WORKSPACE_PATH` env variable. The commandline will always have the priority, if both are set * `accessAuthCode`: Access authorization code (please **be sure to modify**, otherwise anyone can access your data) * In alternative, it's possible to set the auth code via the `SIYUAN_ACCESS_AUTH_CODE` env variable. The commandline will always have the priority, if both are set * To disable the Access authorization code set the env variable `SIYUAN_ACCESS_AUTH_CODE_BYPASS=true` To simplify things, it is recommended to configure the workspace folder path to be consistent on the host and container, such as having both `workspace_dir_host` and `workspace_dir_container` configured as `/siyuan/workspace`. The corresponding startup command would be: ```bash docker run -d \ -v /siyuan/workspace:/siyuan/workspace \ -p 6806:6806 \ -e PUID=1001 -e PGID=1002 \ b3log/siyuan \ --workspace=/siyuan/workspace/ \ --accessAuthCode=xxx ``` #### Docker Compose For users running Siyuan with Docker Compose, the environment variables `PUID` and `PGID` can be passed to customize the user and group IDs. Here's an example of a Docker Compose configuration: ```yaml version: "3.9" services: main: image: b3log/siyuan command: ['--workspace=/siyuan/workspace/', '--accessAuthCode=${AuthCode}'] ports: - 6806:6806 volumes: - /siyuan/workspace:/siyuan/workspace restart: unless-stopped environment: # A list of time zone identifiers can be found at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - TZ=${YOUR_TIME_ZONE} - PUID=${YOUR_USER_PUID} # Customize user ID - PGID=${YOUR_USER_PGID} # Customize group ID

Why self-host SiYuan

Self-hosting gives you three things SaaS can’t: data ownership (the files live on disks you control), cost predictability (a one-time setup vs. recurring per-seat fees that grow with your household or team), and longevity (open-source means the app keeps working even if the maintainers move on, since you can pin a working version). The trade-off is that you take on the operational work of running a server, applying updates, and handling backups.

What hardware do you need

Most self-hosted apps run comfortably on modest hardware — a Raspberry Pi 4, a mini PC, a NAS with Docker support, or a small VPS is usually enough for personal or family use. CPU and RAM requirements scale with how many simultaneous users or how much data you push through SiYuan. Storage requirements depend on the kind of data you keep; check the README for guidance on data retention.

Where to go from here

Last verified: 2026-05-22