---
title: "SiYuan Docker Compose and one-click hosting"
description: "Self-host SiYuan, the open-source note app of blocks, two-way links, Markdown and databases: a Notion and Obsidian alternative you open in a browser."
---

[← All templates](https://pethost.dev/templates/) · [Notes and wikis](https://pethost.dev/templates/notes/)

# 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.

[Deploy on Pethost](https://console.pethost.dev/?template=siyuan)

## 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:
```

[compose.yaml](https://pethost.dev/templates/siyuan/compose.yaml)[See it on GitHub](https://github.com/pethost-dev/templates/tree/main/siyuan)

## [More in Notes and wikis](https://pethost.dev/templates/notes/)

- [**Memos**Short Markdown notes on a private timeline](https://pethost.dev/templates/memos/)
- [**HedgeDoc**Markdown notes you write together in real time](https://pethost.dev/templates/hedgedoc/)
- [**Obsidian LiveSync**A CouchDB server that syncs your Obsidian vaults with Self-hosted LiveSync](https://pethost.dev/templates/obsidian-livesync/)
- [**BookStack**A wiki organised as shelves, books, chapters and pages](https://pethost.dev/templates/bookstack/)
- [**Docmost**A collaborative wiki and docs, with spaces, real-time editing and diagrams](https://pethost.dev/templates/docmost/)
- [**Etherpad**Documents edited together in real time: each author in their own colour, with chat, history and plugins](https://pethost.dev/templates/etherpad/)

Pethost · Stephan Gomer · NIP 1133096755

Pethost

- [Templates](https://pethost.dev/templates/)
- [About](https://pethost.dev/about/)
- [Docs](https://pethost.dev/docs/)
- [Blog](https://pethost.dev/blog/)
- [API](https://pethost.dev/docs/api/)
- [CLI](https://pethost.dev/docs/cli/)
- [Plugin](https://github.com/pethost-dev/plugin)
- [Terms](https://pethost.dev/terms/)
- [Privacy](https://pethost.dev/privacy/)
- [Refunds](https://pethost.dev/refunds/)
- [support@pethost.dev](mailto:support@pethost.dev)

Databases

- [Postgres](https://pethost.dev/postgres/)

Comparisons

- [Coolify vs Dokploy vs CapRover vs Dokku](https://pethost.dev/blog/coolify-vs-dokploy-vs-caprover-vs-dokku/)
- [Coolify Cloud vs Dokploy Cloud](https://pethost.dev/blog/coolify-cloud-vs-dokploy-cloud/)
- [Railway vs Render vs Fly.io pricing](https://pethost.dev/blog/railway-vs-render-vs-fly-io-pricing/)
- [Managed Docker Compose hosting](https://pethost.dev/blog/managed-docker-compose-hosting/)

Alternatives

- [Railway alternatives](https://pethost.dev/blog/railway-alternatives/)
- [Heroku alternatives](https://pethost.dev/blog/heroku-alternatives/)
- [Dokploy alternatives](https://pethost.dev/blog/dokploy-alternatives/)
- [Coolify alternatives](https://pethost.dev/blog/coolify-alternatives/)
- [Render alternatives](https://pethost.dev/blog/render-alternatives/)
- [Sliplane alternatives](https://pethost.dev/blog/sliplane-alternatives/)
