English
Get started

← All templates · Notes and wikis

Deploy SiYuan in one click

A private knowledge base of blocks: notes, outlines, two-way links and databases

A self-hosted alternative to Notion, Obsidian, and Logseq.

What is SiYuan?

SiYuan is a privacy-first knowledge base that people use in place of Notion, Obsidian or Logseq. Everything in it is a block, a paragraph, a heading or a list item, and any block can be referenced, embedded or linked from another, with backlinks shown both ways. It writes Markdown as you see it, with outlines, block zoom-in, math, diagrams, charts and Gantt charts, and holds documents of a million words.

Beyond notes it has databases in table view, flashcards with spaced repetition, PDF annotation linked to your notes, templates, SQL queries embedded in a page, an AI assistant through the OpenAI API, and a marketplace of themes and plugins. It exports standard Markdown, and SiYuan’s own desktop and phone apps keep a workspace of their own.

This template runs SiYuan’s server in Docker, with its workspace in a volume and the lock screen password you give, so it shows nothing to anyone without it. You use it in a browser on any device. On a server, SiYuan does not connect the desktop or phone apps, and it does not export to PDF, Word or HTML or import Markdown files.

Hosting SiYuan on Pethost

  1. You sign in to Pethost with a passkey, GitHub or Google. No machine yet? You pick a plan, and the link waits until it is ready.
  2. New project opens at SiYuan. You fill in what it asks for and click Create project: Password.
  3. In a minute or two SiYuan is live at its own address with HTTPS. Its secrets are made at random, and its data is in the nightly backup.
  4. It is a project like any other: you or your agent can change it, roll it back or restore it.

Questions about SiYuan

Is SiYuan free?

Yes. SiYuan is open source under the AGPL-3.0 license, and most of its features are free, for commercial use too. A one-time PRO purchase adds sync and backup through your own S3 or WebDAV storage, and a subscription adds SiYuan’s own cloud sync.

Can the SiYuan desktop or phone app sync with this server?

No. A SiYuan served from Docker is used in a browser, and the apps cannot open it as a workspace. The apps sync with each other through SiYuan’s cloud or your own S3 or WebDAV storage, which are paid features.

How is SiYuan different from Obsidian?

Obsidian keeps each note as a Markdown file and links notes; SiYuan keeps a structured workspace in which every block can be referenced and embedded, with databases and flashcards built in. SiYuan can serve itself to a browser, as here, and it exports your notes as standard Markdown.

How do I keep strangers out of my SiYuan?

This template gives SiYuan the lock screen password from the first start: the page asks for it before it shows anything, and its API refuses every call without it. Remember me keeps a browser unlocked for 30 days.

How much memory and disk does SiYuan need?

SiYuan is light: about 50 MB of memory at rest, more while it indexes; its workspace starts at about 40 MB and grows with your notes and attachments. On Pethost the Starter plan is enough for it, with room for other apps beside it.

SiYuan Docker Compose file

The template is this compose.yaml and the variables written into the project’s .env as it is created. Pethost runs the file as it is written.

Containers: siyuan (b3log/siyuan:v3.8.8).

Volumes, in the nightly backup: workspace.

services:
  siyuan:
    image: b3log/siyuan:v3.8.8
    restart: unless-stopped
    command: ["serve", "--workspace=/siyuan/workspace/"]
    environment:
      # The lock screen's code: SiYuan shows nothing of the workspace to anyone without it.
      SIYUAN_ACCESS_AUTH_CODE: ${ACCESS_CODE}
      TZ: ${TZ:-UTC}
    volumes:
      - workspace:/siyuan/workspace

volumes:
  workspace:

More in Notes and wikis