# Self-host SiYuan

> A privacy-first, self-hosted personal knowledge management app with block-based markdown notes.

- Page: https://levelrail.com/templates/siyuan/
- JSON: https://levelrail.com/templates/siyuan.json
- Category: Productivity
- Licence: AGPL-3.0 (Network copyleft (AGPL) license)
- Source: https://github.com/siyuan-note/siyuan
- Upstream docs: https://github.com/siyuan-note/siyuan

## Requirements
- Memory: about 512 MiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: v3.8.6

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| siyuan | b3log/siyuan | v3.8.6 | 6806 | siyuan_workspace -> /siyuan/workspace |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| siyuan | PGID | preset |
| siyuan | PUID | preset |
| siyuan | SIYUAN_ACCESS_AUTH_CODE | generated |
| siyuan | TZ | preset |

## Deploy

### CLI

```bash
levelrail-cli templates deploy siyuan --name my-siyuan
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/siyuan/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## Questions

### Can I deploy SiYuan on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for SiYuan, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image b3log/siyuan:v3.8.6 is what you deploy there.

Self-host SiYuan, SiYuan docker compose file, deploy SiYuan on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
