To self-host Obsidian LiveSync on a managed VPS is to keep your notes on a server of your own, which our teams keep up to date and monitor day and night. Self-hosted LiveSync is a free, open source plug-in for Obsidian, under the MIT license, that synchronises your vaults between your computers and phones through a CouchDB database. This guide installs the official CouchDB image at version 3.5.3 with the settings the plug-in checks, and we ran every command on a Simafri VPS before writing it: installation with Docker Compose, HTTPS, a database written and read back over the API, backups, a restore and an update.
By Simon Vasconcelos Lee
Published on 5 December 202611 minute read
couchdb with Docker Compose, port 5984 published on 127.0.0.1 behind an HTTPS reverse proxy: Obsidian on a phone requires HTTPS.local.ini file: required authentication, CORS for the Obsidian origins and the size limits.app://obsidian.md.tar, CouchDB stopped for a few seconds. To update, change the image tag and recreate the container.Self-hosted LiveSync is a community plug-in for Obsidian, the Markdown note-taking app. It synchronises a vault between all your devices, desktop and mobile, through a server you choose, and it is not related to the official Obsidian Sync service, which it cannot synchronise with.
This guide prepares the CouchDB remote, the one the project’s documentation sets up on your own server. Its README advises backing up your vault before you install or upgrade the plug-in, and not running it alongside another synchronisation solution such as iCloud or Obsidian Sync.
Self-hosted LiveSync is published under the MIT license: you can use it free of charge, copy it, modify it and redistribute it, keeping the copyright notice. CouchDB is a project of the Apache Software Foundation, under the Apache License 2.0, which also allows use, modification and redistribution, including for a company. Both are provided without warranty.
Obsidian itself is a separate application, published by its own company under its own terms. Self-hosted LiveSync is installed from its list of community plug-ins.
CouchDB is light. Here is what we measured on our test VPS, with 2 vCPU and 4 GB of memory, after the installation and a 20 MB test document:
Server size therefore depends on the size of your vaults, the number of devices and the other applications you run beside CouchDB. On a managed VPS, tell us about your usage and we will recommend the right size.
The project documents two ways to prepare CouchDB: a Compose file and a script that configures it through its API, or the Docker stack of the repository, whose livesync.ini file and init container apply the same settings. This guide keeps one container and puts every setting in a local.ini file. On a server with Docker Engine and its Compose plugin, installed from Docker’s repository for Ubuntu, create a folder such as /opt/obsidian-livesync and put this compose.yaml in it:
services:
couchdb:
image: couchdb:3.5.3
restart: unless-stopped
environment:
COUCHDB_USER: ${COUCHDB_USER:?set COUCHDB_USER in .env}
COUCHDB_PASSWORD: ${COUCHDB_PASSWORD:?set COUCHDB_PASSWORD in .env}
volumes:
- couchdb_data:/opt/couchdb/data
- couchdb_config:/opt/couchdb/etc/local.d
- ./local.ini:/opt/couchdb/etc/local.ini
ports:
- "127.0.0.1:8124:5984"
volumes:
couchdb_data:
couchdb_config:
Next to it, the local.ini file holds the values that the plug-in’s provisioning script writes and that its setup wizard checks under “Check server requirements”:
; The CouchDB settings that Self-hosted LiveSync checks
[couchdb]
single_node = true
max_document_size = 50000000
[cluster]
n = 1
[chttpd]
require_valid_user = true
enable_cors = true
max_http_request_size = 4294967296
[chttpd_auth]
require_valid_user = true
[httpd]
WWW-Authenticate = Basic realm="couchdb"
enable_cors = true
[cors]
origins = app://obsidian.md,capacitor://localhost,http://localhost
credentials = true
The administrator’s name and password go in a .env file, which Docker Compose reads on its own. Create it readable by root only, then start CouchDB:
umask 077
printf 'COUCHDB_USER=admin\nCOUCHDB_PASSWORD=%s\n' "$(openssl rand -hex 24)" > .env
umask 022
docker compose up -d
docker compose ps
127.0.0.1: the project’s examples publish port 5984 on every address of the server. Published locally, CouchDB is reachable only through the reverse proxy, which provides HTTPS.couchdb_config volume, where CouchDB replaces the password with a PBKDF2 hash.require_valid_user refuses every request without valid credentials, and WWW-Authenticate tells clients to send them.single_node creates the system databases on the first start, and n = 1 keeps one copy of each database, which a server on its own needs.latest. A full version, here 3.5.3, lets you choose when each update happens.couchdb_data holds the databases, and couchdb_config the administrator and the settings CouchDB writes at runtime.CouchDB answered a few seconds after its container started on our test VPS. On the very first start, its log shows a few messages about missing system databases while it creates them. To check that it is ready:
. ./.env
curl -s -u "$COUCHDB_USER:$COUCHDB_PASSWORD" http://127.0.0.1:8124/_up
curl -s -u "$COUCHDB_USER:$COUCHDB_PASSWORD" http://127.0.0.1:8124/
curl -s -u "$COUCHDB_USER:$COUCHDB_PASSWORD" http://127.0.0.1:8124/_all_dbs
The first command returns "status":"ok", the second the welcome message with "version":"3.5.3", and the third the system databases, _replicator and _users. The plug-in reads its settings from the configuration API; this loop shows them the same way:
. ./.env
for k in chttpd/require_valid_user chttpd_auth/require_valid_user httpd/WWW-Authenticate chttpd/enable_cors chttpd/max_http_request_size couchdb/max_document_size cors/credentials cors/origins; do echo "$k $(curl -s -u "$COUCHDB_USER:$COUCHDB_PASSWORD" http://127.0.0.1:8124/_node/_local/_config/$k)"; done
Each line shows the value of local.ini, such as chttpd/require_valid_user "true" and cors/origins "app://obsidian.md,capacitor://localhost,http://localhost".
Obsidian on mobile requires HTTPS with a valid certificate. The container serves CouchDB over HTTP, on port 8124 of the server, and a reverse proxy in front of it handles HTTPS. We tested Caddy, installed from its official Debian and Ubuntu repository: it obtains the Let’s Encrypt certificate itself and renews it. CouchDB sits at the root of its own domain, as the project recommends, and the admin interface, Fauxton, is kept off the internet, as the project’s Docker guide advises:
obsidian-livesync.example.com {
@fauxton path /_utils /_utils/*
respond @fauxton 404
reverse_proxy 127.0.0.1:8124
}
systemctl reload caddy
http://127.0.0.1:8124/_utils/, for example through an SSH tunnel to port 8124.Before you open Obsidian, three checks over HTTPS show that the server is ready for it. A request without credentials must be refused:
curl -sI https://obsidian-livesync.example.com/
The answer is HTTP/2 401, with www-authenticate: Basic realm="couchdb" and via: 1.1 Caddy. Then, with the credentials, the welcome message, the CORS preflight that Obsidian sends before a request, and Fauxton:
. ./.env
U=https://obsidian-livesync.example.com
curl -s -u "$COUCHDB_USER:$COUCHDB_PASSWORD" $U/
curl -s -o /dev/null -D - -X OPTIONS -H 'Origin: app://obsidian.md' -H 'Access-Control-Request-Method: PUT' -H 'Access-Control-Request-Headers: authorization,content-type' $U/obsidiannotes
curl -s -o /dev/null -w '%{http_code}\n' $U/_utils/
The preflight returns HTTP/2 204 with access-control-allow-origin: app://obsidian.md and access-control-allow-credentials: true, and Fauxton returns 404. Last, create the database for your vault, obsidiannotes as in the project’s guides, then write a document in a test database, read it back and delete that database:
. ./.env
U=https://obsidian-livesync.example.com
curl -s -u "$COUCHDB_USER:$COUCHDB_PASSWORD" -X PUT $U/obsidiannotes
curl -s -u "$COUCHDB_USER:$COUCHDB_PASSWORD" -X PUT $U/connection-test
curl -s -u "$COUCHDB_USER:$COUCHDB_PASSWORD" -X PUT -H 'Content-Type: application/json' -d '{"note":"Written over HTTPS"}' $U/connection-test/hello
curl -s -u "$COUCHDB_USER:$COUCHDB_PASSWORD" $U/connection-test/hello
curl -s -u "$COUCHDB_USER:$COUCHDB_PASSWORD" -X DELETE $U/connection-test
Each write answers {"ok":true}, and the document comes back with its _rev. On our test VPS, we also wrote documents in bulk with _bulk_docs, read them from the _changes feed, the two endpoints that replication relies on, and sent a 20 MB document over HTTPS, accepted and read back whole. A wrong password got a 401, like a request with none.
In Obsidian, install Self-hosted LiveSync from the community plug-ins, then follow the project’s Quick Setup for the first device. Without a Setup URI, choose to configure a remote manually, select CouchDB and enter:
https://obsidian-livesync.example.com, your address, without a port.admin and the password from your .env file. The project’s guides use the administrator account, which the server checks and the creation of the database require.obsidiannotes.“Check server requirements” then reads the settings of local.ini. Once a test note has reached the server, the project advises creating a Setup URI from this first device for each additional one, rather than typing the settings again. We did not run Obsidian on our test VPS: the checks above follow the requests the plug-in makes.
Everything lives in three places: the couchdb_data volume with your databases, the couchdb_config volume with the administrator and the runtime settings, and the folder with compose.yaml, local.ini and .env. As in the project’s Docker guide, the copy is made with CouchDB stopped, a few seconds during which the plug-in waits and then resumes. The CouchDB image includes tar:
umask 077
docker compose stop couchdb
docker compose run --rm --no-deps -T --entrypoint tar couchdb -C /opt/couchdb -czf - data etc/local.d > couchdb-$(date +%F).tar.gz
docker compose start couchdb
tar -czf config-$(date +%F).tar.gz compose.yaml local.ini .env
umask 022
The two archives are readable by root only. Schedule this copy and send it off the server. Stored on the disk, the files are also included in the server’s nightly backups. With end-to-end encryption on, the archive holds your notes encrypted: keep your passphrase separately, since the backup cannot be read without it.
CouchDB is restored into empty volumes: on a new server with the same compose.yaml, local.ini and .env, or on the same one after removing the current volumes. The first line checks the archive and removes the volumes only if it is intact; the second extracts it, then starts CouchDB only if the extraction succeeded:
BACKUP_DATE=2026-11-20
(
set -e
for f in couchdb-$BACKUP_DATE.tar.gz; do
test -s "$f" || { echo "Missing or empty: $f"; exit 1; }
done
gzip -t couchdb-$BACKUP_DATE.tar.gz
docker compose down -v
docker compose run --rm --no-deps -T --entrypoint tar couchdb -C /opt/couchdb -xzf - < couchdb-$BACKUP_DATE.tar.gz
docker compose up -d
)
Set BACKUP_DATE, on the first line, to the date in the names of the backup you restore, as listed by ls. The commands run in parentheses with set -e, which stops them at the first error. They first check that each file exists and is not empty, before anything is stopped, removed or overwritten: a wrong date stops there, with your data untouched, and a failed step stops every step after it, so the application is never started again on a partial restore.
We tested the whole cycle on our VPS: archive, volumes removed, an empty CouchDB started to make sure the database was gone, then the restore into new volumes. The database came back with its three documents, the 20 MB one included, and the administrator signed in with the same password. A truncated archive stopped at the first line, and at the second, tar refused it and CouchDB was not started. Before you resume your devices after a restore, follow the project’s recovery guide, which explains how to choose the copy that wins.
Two things are updated separately. The plug-in updates from Obsidian, like any community plug-in, and its releases on GitHub say what each one changes. CouchDB updates with its image: this guide pins 3.5.3, the most recent image on Docker Hub when we tested it, so check the tags page for a newer release before you install. Take a backup, change the image tag in compose.yaml, then pull the new image and recreate the container:
docker compose pull
docker compose up -d
The welcome message shows the new version:
. ./.env
curl -s -u "$COUCHDB_USER:$COUCHDB_PASSWORD" http://127.0.0.1:8124/
"version":"3.5.3", the document written before the update was there, and the log showed no error.docker compose up -d replaces the container and keeps the databases and the configuration. Never add -v to docker compose down outside a restore: it deletes them.-nouveau tags are a variant with the Nouveau search engine, which the plug-in does not use: stay on the plain tags.Self-hosting means running the server on top of the application. On a managed VPS, our teams take charge of the server and proactively monitor your CouchDB instance; Self-hosted LiveSync remains your tool, with your vaults, your encryption passphrase and your settings.
| Topic | Our teams | You |
|---|---|---|
| The server | System and security updates, server interventions included | The timing that suits you |
| Monitoring | Server monitored 24/7, with intervention without waiting for your call | Your vaults and your devices in Obsidian |
| CouchDB | Proactive monitoring: errors, slowdowns and disk space spotted, fix recommended | Its installation, updates and settings, which you apply, yourself or through your AI assistant |
| Encryption | The server that stores your encrypted data, monitored and backed up | Your end-to-end encryption passphrase, which never reaches the server |
| Backups | Every night, encrypted and kept off the machine; restores included | CouchDB’s own archives, and the restore request, when you need one |
| Migration | Your current server migrated, free of charge | The timing of the switch |
If you would rather have our teams work inside the application itself, that service is billed by the hour or at a fixed rate, with an estimate shared before the work starts.
With a Simafri Managed VPS, our teams keep the server of your CouchDB instance up to date, monitor it day and night and step in without waiting for your call; they also proactively monitor your instance and recommend useful fixes, which you apply, yourself or through your AI assistant. Backups are encrypted every night and kept off the machine, restores are included, and migrating your current server is free.
Yes. The plug-in is under the MIT license and CouchDB under the Apache License 2.0: neither has a license to buy, for personal or business use. What remains is the cost of the server that runs CouchDB.
Run the official couchdb image with Docker Compose, the administrator in a .env file and the settings the plug-in checks in a local.ini file: required authentication, CORS for app://obsidian.md, capacitor://localhost and http://localhost, and the size limits. Publish port 5984 on 127.0.0.1 and put an HTTPS reverse proxy in front.
On mobile, yes: Obsidian requires HTTPS with a valid certificate. A desktop device can use plain HTTP on a trusted local network only. A reverse proxy such as Caddy obtains and renews a Let’s Encrypt certificate on its own.
require_valid_user set to true, the WWW-Authenticate header, CORS turned on with credentials and the three Obsidian origins, max_http_request_size of 4294967296 and max_document_size of 50000000. The plug-in checks them under Check server requirements.
Little. On our test VPS, CouchDB used about 180 MB of memory at rest and its image takes about 160 MB of disk. The database grows with your vaults and their history.
Stop CouchDB for a few seconds, archive /opt/couchdb/data and /opt/couchdb/etc/local.d from its image with tar, start it again, and keep a copy of compose.yaml, local.ini and .env. With end-to-end encryption, also keep your passphrase: the backup holds encrypted data.
Not with end-to-end encryption turned on in the plug-in: notes are encrypted on your devices with a passphrase that never reaches the server, which stores only encrypted data.
A managed VPS covers the server: system, security, monitoring and backups. Our teams also proactively monitor your CouchDB instance and recommend useful fixes, which you apply. Work inside the application is billed by the hour or at a fixed rate.
Simafri
Let's talk about your project
Tell us what you need in a few words: we will get back to you quickly.
Thank you! Your request has been sent. We'll get back to you shortly.
Prefer email? Write to us at support@simafri.com.