I use Obsidian for notes, and my vault has grown into something I genuinely depend on — research, project notes, writing drafts. Keeping it synced across my laptop, desktop, and phone became important enough that I looked at the official sync service.
The price made sense for a few months, but for something this central to my workflow, I'd rather own the infrastructure. Obsidian works with plain Markdown files, so the sync layer is replaceable.
This guide covers two approaches: the simple one (Syncthing for desktop-to-desktop) and the full one (CouchDB + Obsidian LiveSync for real-time sync including mobile). I'll help you decide which fits your situation.
This guide covers two approaches: Syncthing (the simplest, for file sync without a server component) and Obsidian LiveSync (which uses a CouchDB backend on your server for real-time sync and conflict resolution).
For most people, the self-hosted CouchDB + Obsidian LiveSync approach gives you the closest experience to official Obsidian Sync at a fraction of the cost.
I sync my Obsidian vault via a CouchDB instance on Tencent Cloud Lighthouse. The entry-level plan handles CouchDB for a personal vault easily — CouchDB is not resource-intensive. What makes Lighthouse work well as a sync relay: the server runs continuously and reliably, so changes sync between your devices whenever they connect — even if you open Obsidian on mobile at 2am, the latest notes are there. The static public IP means your CouchDB endpoint URL stays consistent permanently, and OrcaTerm lets you check sync status or restart CouchDB from any browser.
- Key Takeaways
| Feature | CouchDB + LiveSync | Syncthing |
|---|---|---|
| Conflict resolution | Smart merge (plugin handles) | Basic (creates conflict files) |
| Mobile sync | Yes (iOS/Android) | Yes |
| End-to-end encryption | Optional (plugin supports it) | Optional |
| Real-time sync | Yes | Near-real-time |
| Server requirement | CouchDB | None (P2P) |
| Setup complexity | Moderate | Simple |
| Works without internet | No (needs server) | Yes (LAN sync) |
Recommendation: If you use multiple devices including mobile, use LiveSync + CouchDB. If you only sync between desktop machines, Syncthing is simpler.
| Requirement | Details |
|---|---|
| Server | Ubuntu 22.04, 1 GB+ RAM |
| Docker | Installed |
| Obsidian | Installed on your devices |
| Domain | For HTTPS access (required for mobile) |
curl -fsSL https://get.docker.com | sh
sudo systemctl enable docker
mkdir -p /opt/couchdb/data
docker run -d \
--name couchdb \
--restart=always \
-p 127.0.0.1:5984:5984 \
-e COUCHDB_USER=admin \
-e COUCHDB_PASSWORD=your-secure-password \
-v /opt/couchdb/data:/opt/couchdb/data \
couchdb:3
CouchDB needs to be initialized in single-node mode:
curl -X POST http://admin:your-secure-password@localhost:5984/_cluster_setup \
-H "Content-Type: application/json" \
-d '{"action": "finish_cluster"}'
Expected response: {"ok":true}
curl -X PUT http://admin:your-secure-password@localhost:5984/obsidian-vault
Verify:
curl http://admin:your-secure-password@localhost:5984/_all_dbs
# Should show: ["_replicator","_users","obsidian-vault"]
CouchDB needs to be accessible via HTTPS for mobile Obsidian clients.
sudo apt install -y nginx certbot python3-certbot-nginx
sudo nano /etc/nginx/sites-available/couchdb
server {
listen 80;
server_name couch.yourdomain.com;
location / {
proxy_pass http://localhost:5984;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# CouchDB requires these headers for CORS
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type' always;
if ($request_method = 'OPTIONS') {
return 204;
}
}
}
sudo ln -s /etc/nginx/sites-available/couchdb /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
sudo certbot --nginx -d couch.yourdomain.com
curl -X PUT http://admin:your-secure-password@localhost:5984/_node/nonode@nohost/_config/httpd/enable_cors \
-d '"true"'
curl -X PUT http://admin:your-secure-password@localhost:5984/_node/nonode@nohost/_config/cors/origins \
-d '"*"'
curl -X PUT http://admin:your-secure-password@localhost:5984/_node/nonode@nohost/_config/cors/credentials \
-d '"true"'
curl -X PUT http://admin:your-secure-password@localhost:5984/_node/nonode@nohost/_config/cors/methods \
-d '"GET, PUT, POST, HEAD, DELETE"'
curl -X PUT http://admin:your-secure-password@localhost:5984/_node/nonode@nohost/_config/cors/headers \
-d '"accept, authorization, content-type, origin, referer"'
In Obsidian:
Go to Settings → Self-hosted LiveSync:
https://couch.yourdomain.comadminobsidian-vaultClick Test — you should see a successful connection.
Recommended settings for personal use:
LiveSync (real-time)50 (good default)Click Apply and then Start Sync.
Your vault starts syncing. First sync uploads all notes to CouchDB.
The plugin downloads all notes from CouchDB. Your vault is now synchronized.
Same process: install Obsidian mobile, install LiveSync plugin, enter CouchDB settings.
Note for iOS: Obsidian on iOS requires using HTTPS with a valid certificate. The Nginx + Certbot setup above handles this.
If you prefer simplicity and don't need mobile sync, Syncthing works well for desktop-to-desktop vault sync.
Install Syncthing on your server (covered in guide #72), then:
Advantages: No CouchDB, no plugin, syncs plain files.
Limitations: Less robust conflict handling; mobile sync is more complex.
For pure desktop sync, Syncthing is the simpler and more reliable choice.
After setting up CouchDB and configuring LiveSync, the plugin showed "Connected" but notes weren't appearing on my second device.
The issue: I'd created the CouchDB database but hadn't properly initialized the single-node cluster. CouchDB in Docker requires the finish_cluster API call to be ready for replication — without it, database operations succeed but replication doesn't work.
Also, the plugin kept showing a "400 Bad Request" for certain requests, which turned out to be a CORS configuration issue. My Nginx config wasn't sending CORS headers for 401 (authentication required) responses.
The fix for CORS on auth responses:
location / {
proxy_pass http://localhost:5984;
# Must add headers to ALL responses including 401/403
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type, Accept' always;
add_header 'Access-Control-Allow-Methods' 'GET, PUT, POST, HEAD, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
if ($request_method = 'OPTIONS') {
return 204;
}
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
The key is always at the end of add_header directives — without it, Nginx only adds headers to 200/304 responses, not error responses.
| Issue | Likely Cause | Fix |
|---|---|---|
| "Connection failed" in plugin | Wrong URL or credentials | Test URL directly: curl https://couch.yourdomain.com |
| Notes not syncing | Cluster not initialized | Run finish_cluster API call |
| CORS errors in browser | Missing CORS headers | Add always to add_header in Nginx |
| Sync conflicts | Same note edited on two devices | LiveSync merges automatically; check plugin settings |
| Mobile can't connect | Self-signed cert | Use Let's Encrypt (Certbot) — not self-signed |
| CouchDB container stops | Out of memory | Upgrade to 2 GB RAM |
| Database not found | Wrong database name | Verify database exists: curl .../obsidian-vault |
✅ What you built:
Monthly cost: the price of your cloud server (~$5–6/month). Compared to Obsidian Sync at $8–16/month, you save money and gain complete data ownership.
What data does self-hosted Obsidian sync protect compared to cloud services?
Your content — notes, documents, calendar events, tasks — is stored on your server and never sent to a third party's infrastructure. This matters for sensitive personal or professional information.
Can I collaborate with others on a self-hosted Obsidian sync instance?
Most productivity tools support multiple users. The number of users depends on the tool and your server resources. Check the guide's prerequisites for per-user resource estimates.
How do I access self-hosted Obsidian sync from mobile devices?
Install the official mobile app and configure it to connect to your server URL instead of the default cloud service. The setup is typically done in the app's server settings.
What happens to my data if the server goes down?
Data on the server is preserved. You won't have access until the server is restored, but data isn't lost. Lighthouse snapshots provide backup and quick recovery.
docker compose pull) are typically straightforward. The guide includes update instructions specific to the application.👉 Get started with Tencent Cloud Lighthouse
👉 View current pricing and launch promotions
👉 Explore all active deals and offers