Self-hosted sync server for Obsidian with SQLite storage and optional Git backups.
2.0K
⚠️ Early development — This server is in active early development. Use at your own risk.
A self-hosted sync backend for the obsidian-crdt-sync Obsidian plugin. It keeps your vault state in one place so your devices can stay in sync without giving your notes to a third-party service.
Copy .env.example to .env and set AUTH_TOKEN:
cp .env.example .env
# edit .env and set AUTH_TOKEN
Generate a token with:
openssl rand -base64 32
Then start the server:
docker compose up -d
docker run -d \
-p 3000:3000 \
-v ./data:/data \
-e AUTH_TOKEN="your-random-secret-at-least-32-chars" \
-e DATA_DIR=/data/db \
-e BACKUP_GIT_WORKTREE_DIR=/data/git \
yusoltsev/obsidian-crdt-sync-server:latest
bun install
bun src/index.ts
Set environment variables via a .env file or export them before running. See .env.example for all options.
| Variable | Required | Default | Description |
|---|---|---|---|
AUTH_TOKEN | ✅ | — | Shared secret for WebSocket auth (min 32 chars) |
PORT | 3000 | Port to listen on | |
DATA_DIR | ./data/db | Directory for the SQLite database | |
BACKUP_GIT_INTERVAL_MINUTES | — | Enable periodic Git backup (positive integer) | |
BACKUP_GIT_URL | when backup enabled | — | HTTPS remote URL |
BACKUP_GIT_USERNAME | when backup enabled | — | Git HTTPS username |
BACKUP_GIT_PASSWORD | when backup enabled | — | Git HTTPS password or token |
BACKUP_GIT_BRANCH | main | Branch to push backups to | |
BACKUP_GIT_WORKTREE_DIR | ./data/git | Local worktree directory | |
BACKUP_GIT_AUTHOR_NAME | Obsidian Sync | Git author name for backup commits | |
BACKUP_GIT_AUTHOR_EMAIL | obsidian-sync@localhost | Git author email for backup commits |
GET /health returns {"status":"ok"} with HTTP 200.
DATA_DIR accordingly.BACKUP_GIT_PASSWORD is used as a plain HTTPS password or personal access token. Use a token with minimal required permissions.This server is published as a multi-platform Docker image for linux/amd64 and linux/arm64.
Images are available from:
Create a release tag from a clean main branch:
bun run release patch
# or: bun run release minor
# or: bun run release major
The local release script computes the next semantic version from existing Git tags, creates the new X.Y.Z tag, and pushes it to GitHub.
The GitHub Actions release workflow then runs GoReleaser on that tag. GoReleaser installs dependencies, builds a bundled main.js, creates the GitHub release, and builds/publishes the Docker image to both Docker Hub and GHCR by copying only that file into the runtime image.
For a local dry run of the release pipeline:
goreleaser release --snapshot --clean
For a plain local image build without GoReleaser:
bun run build
docker build -t obsidian-crdt-sync-server:test .
This project uses Semantic Versioning. Release tags use the plain X.Y.Z format and drive both GitHub releases and Docker image tags.
Pull requests are welcome. For larger changes, open an issue first, especially if the change affects the wire protocol, on-disk storage format, or release packaging.
Content type
Image
Digest
sha256:219cf3971…
Size
49.4 MB
Last updated
6 months ago
docker pull yusoltsev/obsidian-crdt-sync-server