
Deploy Obsidian LiveSync — Self-Hosted CouchDB Sync Server
Self-host Obsidian sync — private CouchDB for LiveSync, mobile ready
Obsidian Livesync
Just deployed
/opt/couchdb/data
Deploy and Host Obsidian LiveSync CouchDB on Railway
This template deploys a CouchDB server pre-configured for the Obsidian Self-hosted LiveSync plugin — the fiddly part of self-hosting Obsidian sync, done for you. Instead of hand-writing CouchDB's CORS, auth, and request-size settings (and debugging why mobile won't connect), you get a working sync backend with the exact configuration LiveSync needs, plus automatic HTTPS so mobile Obsidian works out of the box. Own your notes, sync across every device in real time, end-to-end encrypted.
What This Template Deploys
| Service | Purpose |
|---|---|
| CouchDB | The sync database, pre-configured for Obsidian LiveSync, on port 5984 |
A single service with a persistent volume for your synced note data. CouchDB ships with the exact CORS, authentication, and request-size settings the LiveSync plugin requires — the configuration that's tedious and error-prone to get right by hand.
About Hosting
Self-hosting Obsidian sync is really about one thing: configuring CouchDB correctly. That's where every DIY attempt gets stuck, and it's what this template solves.
The CouchDB config is pre-baked — including the settings everyone gets wrong. LiveSync needs CouchDB tuned with specific settings: single_node=true, require_valid_user=true on both [chttpd] and [chttpd_auth], a large max_http_request_size for bulk syncs, a raised max_document_size for attachments, and — the part that trips up almost everyone — a precise [cors] block. This template ships all of it correct, so the plugin connects on the first try instead of failing with cryptic errors.
The CORS origins are the number-one gotcha — and they're set right. LiveSync connects from the Obsidian app, so CouchDB's CORS must allow the exact origins app://obsidian.md and capacitor://localhost, with credentials=true and specific headers and methods. The capacitor://localhost origin is what makes mobile Obsidian work, and it's the single most common thing people forget — leaving mobile sync mysteriously broken. This template includes it, so desktop and mobile both connect.
Automatic HTTPS means mobile sync just works. Mobile Obsidian requires a valid SSL certificate, which normally forces a reverse proxy, Cloudflare Tunnel, or Let's Encrypt by hand. Railway provides automatic HTTPS on your domain, so mobile connects securely with zero extra setup — one of the biggest advantages of hosting here.
Set your admin credentials and create the database. COUCHDB_USER and COUCHDB_PASSWORD create the admin on first boot — use a strong password. After deploy, create a database (commonly obsidian-livesync) to point the plugin at, then use LiveSync's Setup URI to clone the config to your other devices.
Your notes persist on the volume. All synced data lives in CouchDB's data directory on a persistent volume, so it survives redeploys. Because it holds your entire vault, back it up, and compact the database periodically to reclaim space from CouchDB's revision history.
Typical cost: ~$5/month on Railway for the single CouchDB service. CouchDB and the LiveSync plugin are both free and open source — a one-time setup versus Obsidian Sync's ongoing subscription.
How It Compares
| LiveSync + CouchDB (self-hosted) | Obsidian Sync (official) | iCloud / Dropbox | Git-based sync | |
|---|---|---|---|---|
| Cost | ~$5/mo infra | Subscription | Storage plan | Free |
| Real-time sync | Yes | Yes | File-level | Manual/commit |
| Mobile support | Yes (with HTTPS) | Yes | Partial | Clunky |
| Conflict handling | Built-in | Built-in | Poor | Manual merge |
| End-to-end encryption | Yes | Yes | No | No |
| Data ownership | Full — your server | Vendor | Vendor | Full |
Obsidian's official Sync is polished but a paid subscription on their servers. iCloud and Dropbox sync files but handle Obsidian's rapid small writes and conflicts poorly, causing sync errors. Git works but is manual and awkward on mobile. LiveSync with your own CouchDB gives real-time, end-to-end-encrypted sync across every device with proper conflict resolution — on infrastructure you own, for the cost of a small server.
Deploy in Under 5 Minutes
- Click Deploy on Railway — CouchDB builds with the LiveSync config applied (~2 minutes)
- Set
COUCHDB_USERand a strongCOUCHDB_PASSWORD - Confirm the volume is mounted and note your Railway public HTTPS domain
- Create a database named
obsidian-livesync(via the CouchDB dashboard at/_utils) - In Obsidian, install the Self-hosted LiveSync plugin and enter your domain, database name, and credentials
Use LiveSync's "Copy setup URI" to configure your phone and other devices in seconds.
Common Use Cases
- Cross-device note sync — keep your vault in sync across desktop, laptop, and phone in real time
- Private Obsidian Sync alternative — the same experience as the paid service, on your own server
- Mobile Obsidian sync — reliable phone syncing thanks to automatic HTTPS and the right CORS origins
- Escape file-sync conflicts — replace iCloud/Dropbox sync errors with CouchDB's proper conflict handling
Configuration
| Variable | Required | Description |
|---|---|---|
COUCHDB_USER | Required | Admin username created on first boot |
COUCHDB_PASSWORD | Required | Admin password — use a strong value; it guards all your notes |
PORT | Pre-set | 5984 — the CouchDB HTTP API |
| CORS / chttpd settings | Pre-set | The LiveSync-required config (origins, auth, request size) baked in |
The LiveSync CouchDB config is already applied. The CORS origins (
app://obsidian.md,capacitor://localhost),require_valid_user,single_node, and large request/document sizes are all set — the settings that make DIY setups fail. You just set credentials and create the database.
Mobile needs HTTPS — Railway provides it. Mobile Obsidian requires a valid SSL certificate; Railway's automatic HTTPS handles it with no reverse proxy. Use a strong
COUCHDB_PASSWORD, since it protects your entire vault.
Dependencies for Obsidian LiveSync CouchDB Hosting
- Railway account — ~$5/month for the CouchDB service
- A persistent Railway volume for your synced note data (included)
- The Self-hosted LiveSync plugin installed in Obsidian (free, community plugins)
- Your Railway public HTTPS domain (automatic)
Deployment Dependencies
- Obsidian LiveSync Plugin (GitHub)
- LiveSync Server Setup Guide
- Apache CouchDB Documentation
- Railway Volumes Documentation
Implementation Details
The template runs the official CouchDB image on port 5984 with configuration pre-applied for the Obsidian Self-hosted LiveSync plugin: single_node=true, require_valid_user=true under both [chttpd] and [chttpd_auth], a large max_http_request_size and max_document_size for bulk syncs and attachments, and a [cors] block permitting the app://obsidian.md and capacitor://localhost origins with credentials=true and the required headers and methods. The capacitor://localhost origin enables mobile clients, and its omission is the most common cause of failed mobile sync in DIY setups.
COUCHDB_USER and COUCHDB_PASSWORD create the admin on first boot, and synced data persists on a mounted volume. Because mobile Obsidian requires HTTPS, Railway's automatic TLS removes the reverse-proxy or tunnel step self-hosting normally demands. After deploy, a database (typically obsidian-livesync) is created via the CouchDB dashboard, and the plugin is pointed at the Railway domain with the database name and credentials; LiveSync's Setup URI then propagates the config to other devices.
Frequently Asked Questions
Why is self-hosting Obsidian sync usually hard? The difficulty is CouchDB's configuration — CORS origins, auth, and request-size settings that must be exact, or the plugin fails to connect. This template pre-applies all of it, so you skip the part that breaks most setups.
Why wasn't my mobile syncing in other setups? Almost always a missing capacitor://localhost CORS origin and/or no HTTPS. This template includes that origin and Railway provides automatic HTTPS, so mobile connects.
Do I need a reverse proxy for SSL? No. Railway gives you automatic HTTPS on your public domain, which is exactly what mobile Obsidian requires — no Nginx, Cloudflare Tunnel, or manual certificates.
How do I set it up in Obsidian? Install the Self-hosted LiveSync community plugin, then enter your Railway HTTPS domain, the database name (obsidian-livesync), and your CouchDB credentials. Use the Setup URI to copy the config to other devices.
Does my synced data persist? Yes, on the mounted volume. Back it up regularly since it holds your entire vault, and compact the database periodically to reclaim space.
Can multiple devices sync to it? Yes — desktop and mobile devices all sync to the same CouchDB in real time, with built-in conflict resolution if two devices edit offline.
Why Deploy Obsidian LiveSync CouchDB on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying this on Railway you get the hard part of self-hosted Obsidian sync solved — CouchDB pre-configured with the exact CORS and auth settings LiveSync needs, automatic HTTPS so mobile works, and a persistent volume for your vault. Real-time, end-to-end-encrypted note sync across every device, on infrastructure you own.
Template Content
Obsidian Livesync
BURNI80/obsidian-livesync-railway