Analytics cookies only (Google Analytics, PostHog). No ad networks, no cross-site tracking. See our privacy policy.
Self-host SiYuan
updated Oct 2026deployed by usprices checked · Jul 2026Install verified on Ubuntu 26.04 · Oct 2026 · how we test
We earn commissions when you shop through the links below. Full disclosure →
A block-based personal knowledge management system: block-level references and two-way links, Markdown WYSIWYG editing, a database table view, flashcards with spaced repetition and PDF annotation, served from your own server to the browser. The user interface and Go kernel are AGPL-3.0, with notes stored as JSON files in a workspace folder you mount; the Docker build is browser-only and some member features are paid.
Runs on a VPS from $6/mo (Kamatera 2GB, 2 GB RAM) · prices checked Sep 2026
Our recommendation
Pick SiYuan when you want a block-based personal knowledge base served from your own server: block-level references and two-way links, Markdown WYSIWYG editing, a database table view, flashcards with spaced repetition, PDF annotation links and SQL query embeds, all in the browser. The user interface and the Go kernel are AGPL-3.0; most features are free, even for commercial use, with member privileges behind a paid tier. The official `b3log/siyuan` image is one container with no separate database: notes are JSON `.sy` files in the workspace folder you mount, indexed by SQLite inside the container. Our snippet runs that container with a generated lock-screen access code. Upstream publishes no RAM minimum, so our 512 MB floor is an estimate. Trilium is the catalog's closest sibling, another one-container hierarchical note base; Joplin Server only syncs notes for the Joplin apps, while SiYuan's Docker build is the full editor in the browser, though it cannot accept the SiYuan desktop or mobile apps as clients.
What you need
Any VPS with at least 512 MB of RAM
A domain you control — most self-hosted setups need HTTPS in front of them
Paid link — we earn a commission if you shop through it.
Install
Run these commands on your server:
# SiYuan — personal knowledge base served to the browser — based on the Docker Compose example in the SiYuan README, pinned to v3.8.7mkdir -p workspace && echo "SIYUAN_ACCESS_AUTH_CODE=$(openssl rand -hex 16)" > .envcat > docker-compose.yml <<'EOF'services: siyuan: image: b3log/siyuan:v3.8.7 command: ['serve', '--workspace=/siyuan/workspace/'] restart: unless-stopped ports: - 6806:6806 volumes: - ./workspace:/siyuan/workspace environment: PUID: 1000 PGID: 1000 SIYUAN_ACCESS_AUTH_CODE: ${SIYUAN_ACCESS_AUTH_CODE}EOFdocker compose up -d# wait for the kernel to come up: the lock screen at /check-auth answers 200 (every other path answers 401 until you enter the code)timeout 120 bash -c 'until curl -sf http://localhost:6806/check-auth >/dev/null; do sleep 3; done'# → http://SERVER_IP:6806 — the lock screen asks for the access code stored in .env
SiYuan's README is explicit about what the Docker build can and cannot do:
non-negotiableThe Docker build is browser-only: upstream lists no desktop or mobile application connections, no export to PDF, HTML or Word, and no Markdown file import as limitations of the container. Most features are free, including commercial use, but member privileges are paid; see upstream's pricing page before you plan around them.
non-negotiableEverything lives in the mounted workspace, from assets and templates to the notebook folders of .sy JSON documents, and the README warns that if the mounted volume is wrong the data is lost when the container is deleted. Back up the whole workspace folder, and keep PUID and PGID matched to the owner of that host directory or you will hit permission errors.
non-negotiableUpstream's compose example runs the untagged b3log/siyuan image; pin a release tag as our snippet does. Recent images require the serve subcommand to be passed explicitly, so an older compose file that omits it stops working after an image update, and the README's Kubernetes notes add that you should back up before upgrades because storage-format migrations are not undone by a rollback.
non-negotiablePort 6806 is plain HTTP, and the lock-screen access code is the only thing between the internet and your notes; the README says to be sure to set it, otherwise anyone can access your data, and SIYUAN_ACCESS_AUTH_CODE_BYPASS=true removes it entirely. Put an NGINX-style reverse proxy with TLS in front, proxy WebSockets on /ws, preserve the original Host header including the port, and do not use URL rewriting, or authentication and the WebSocket connection fail.