Skip to content

Set Up Obsidian LiveSync on a Linux Server – Sync Notes with Your Own CouchDB

CouchDB for the Obsidian plugin Self-hosted LiveSync: as a One-Click App with HTTPS or via Docker Compose, plus plugin setup, Setup URI and encryption.

29 November 202611 min read2 Views0 helpful

Introduction

Self-hosted LiveSync is a community plugin for Obsidian that syncs your notes between your PC, laptop, and smartphone. Instead of using a third-party service, your data is transferred through a server you run yourself. The plugin uses a CouchDB database for storage. Changes appear on your other devices almost in real time, and each device keeps a full copy of your vault.

The Obsidian Livesync One-Click App provides exactly this: a CouchDB that is already configured for the plugin. It is not an Obsidian interface; you continue working in the Obsidian app on your devices. If you want to use Obsidian itself in a browser on the server, Set Up Obsidian on a Linux Server is the right guide.

In this guide, we’ll show you two ways to set up CouchDB: the easy way, as a One-Click App, and a manual installation with Docker Compose. Then you’ll set up the plugin on your first device, connect additional devices, and learn what end-to-end encryption does and how to handle conflicts.

When LiveSync Makes Sense on a VPS

Running your own LiveSync server on a VPS makes sense if:

  • You use Obsidian on multiple devices, such as a PC and smartphone, and want your notes to be the same everywhere.
  • You don’t want your notes stored with a third-party provider. The database runs on your server, and with end-to-end encryption, nobody there can see your content.
  • You want changes to appear on all your devices right away. The server is always available, even when your other devices are turned off.
  • You don’t want to pay for a subscription service to sync your notes and are happy to manage the server and backups yourself.

LiveSync is less suitable if you only use one device or don’t want a plugin with lots of settings. In that case, the official Obsidian Sync service is more convenient. If you want to use Obsidian in a browser without installing it, use the Obsidian One-Click App.

Easy Option: Obsidian LiveSync as a One-Click App

The quickest way to get CouchDB running is through your VPS’s One-Click Apps. With a domain, it’s available directly over HTTPS and protected by a login. HTTPS is important: the Obsidian app on your smartphone only connects to servers with a valid certificate.

Requirements

  • A Linux VPS (Debian or Ubuntu) with One-Click Apps set up. See Set Up One-Click Apps for instructions.
  • Low resource requirements: On our test VPS, CouchDB used around 100 MB of RAM, and the image is just under 500 MB. Storage usage grows with your vault because the database also keeps older versions of your notes.

Install

  1. Open your VPS in the ZapX dashboard and switch to the One-Click Apps tab.
  2. Search the app catalog for Obsidian Livesync and click Install app. Make sure you select the right entry: Obsidian without the additional word is the desktop app in a browser, not the sync server.
  3. Use a custom subdomain or zap.cloud is already selected, with a random name. Leave it enabled or enter your own name, such as sync.
  4. Under App configuration, MAX_DOCUMENT_SIZE and MAX_HTTP_REQUEST_SIZE are set to default values. Leave them unchanged.
  5. Click Queue installation.

After one or two minutes, the app card will show Online. Your CouchDB address is the app’s domain, for example https://sync-12345.zap.cloud. You can find it in the app’s settings (gear icon) under App actions.

CouchDB credentials

CouchDB is protected by a username and password. The installation generates both automatically, but the app card doesn’t display them:

  1. Click the gear icon on the app card and open App environment.
  2. Under Automatically generated values, you’ll find SERVICE_USER_COUCHDB (username) and SERVICE_PASSWORD_64_COUCHDB (password, 64 characters). Click the eye icon to show them, or the icon next to it to copy them.

This is the CouchDB administrator account. The plugin uses these credentials to connect, and you also use them to sign in to the web interface.

Info: No access without signing in

In our test, every request without credentials returned a 401 error, including requests to the web interface and attempts to write data. Access for Obsidian (CORS for desktop and smartphone) is already configured, so you don’t need to change anything in CouchDB.

Fauxton web interface

CouchDB has its own web interface, called Fauxton. To open it, add /_utils/ to your app address, for example https://sync-12345.zap.cloud/_utils/. Sign in with the username and password from App environment. After setup, you’ll see your vault’s database under Databases. You don’t need Fauxton for everyday use, but it can help you check whether data is coming through.

If you use the Access link to open the address without /_utils/, CouchDB displays a short response in JSON format after you sign in. This is normal and shows that the server is running.

Updates and backups

You can update CouchDB in the app’s settings (gear icon), under App update. Click Check for updates, then install a new version using Apply update. If it says the app is up to date, there isn’t a newer version in the app catalog yet. Your databases are stored in a separate volume and are preserved during updates.

Back up your entire VPS using Backups in the dashboard. Since every connected device has a full copy of your vault, your notes won’t be lost if there’s a problem with the server. Still, make an additional backup of the vault on one of your devices.

Manual installation

The rest of this guide describes a manual installation of CouchDB with Docker Compose on your VPS. This is useful, for example, if you don’t use One-Click Apps on the server or want to run CouchDB behind your own reverse proxy. The configuration follows the LiveSync project’s guide.

Requirements

  • A Linux VPS running Debian or Ubuntu, with SSH access. See First access via SSH.
  • Docker and Docker Compose (Compose v2). See Install Docker.
  • A domain or subdomain whose A record points to your VPS’s IP address (for example, sync.example.com). For smartphones, you need HTTPS with a valid certificate.

The following are guidelines based on our test of CouchDB alone:

HardwareMinimumRecommended
CPU1 vCPU core2 vCPU cores
RAM1 GB2 GB
Storage5 GB20 GB

Prepare the firewall

CouchDB listens on port 5984. Don’t open this port; devices should only reach the database through the reverse proxy. Use ufw to allow only SSH and the HTTP and HTTPS ports:

Code
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
Warning: Docker bypasses ufw

Ports published by Docker using ports: are also reachable from outside, even if ufw blocks them. That’s why you should bind CouchDB to 127.0.0.1 as described below. For more information, see Open Ports and Manage the Firewall.

Install with Docker Compose

Create a directory, then create a .env file in it with your credentials. Generate a random password with openssl rand -hex 24:

Code
mkdir -p /opt/livesync
cd /opt/livesync
nano .env
Code
COUCHDB_USER=obsidian
COUCHDB_PASSWORD=CHANGE_ME

Replace CHANGE_ME with your password and protect the file with chmod 600 .env. Then create a livesync.ini file with the settings for the plugin:

Code
[couchdb]
single_node = true
max_document_size = 50000000

[chttpd]
require_valid_user = true
max_http_request_size = 4294967296
enable_cors = true

[chttpd_auth]
require_valid_user = true
authentication_redirect = /_utils/session.html

[httpd]
WWW-Authenticate = Basic realm="couchdb"

[cors]
origins = app://obsidian.md,capacitor://localhost,http://localhost
credentials = true
headers = accept, authorization, content-type, origin, referer
methods = GET, PUT, POST, HEAD, DELETE
max_age = 3600

Finally, create docker-compose.yml:

Code
services:
  couchdb:
    image: couchdb:3.5.3
    container_name: livesync-couchdb
    restart: unless-stopped
    env_file: .env
    volumes:
      - ./livesync.ini:/opt/couchdb/etc/local.d/livesync.ini
      - ./data:/opt/couchdb/data
    ports:
      - "127.0.0.1:5984:5984"

Here’s what the important lines do:

  • require_valid_user: Nothing is accessible without signing in, including the web interface. Without these lines, anyone could read the databases.
  • [cors]: Allows the Obsidian app on desktop (app://obsidian.md) and smartphone (capacitor://localhost) to connect. Without it, the plugin won’t be able to connect.
  • max_document_size and max_http_request_size: The limits the plugin expects for larger files and the initial sync.
  • 127.0.0.1:5984:5984: CouchDB is only accessible from the server itself. It can only be reached from outside through the reverse proxy.

Start CouchDB and check that it responds:

Code
docker compose up -d
curl -u obsidian:PASSWORD http://127.0.0.1:5984/_up

Replace PASSWORD with your password from .env. The response {"status":"ok"} means everything is working. Without credentials, CouchDB responds with 401, as it should.

Access via HTTPS through a reverse proxy

For the basics, see Set Up a Reverse Proxy with nginx and Create an SSL Certificate (Let's Encrypt). Here’s a server block for nginx:

Code
server {
    listen 80;
    server_name sync.example.com;

    location / {
        proxy_pass http://127.0.0.1:5984;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_buffering off;
        client_max_body_size 50M;
    }
}

Then get the certificate with certbot --nginx -d sync.example.com. Two lines are important for LiveSync: proxy_buffering off prevents the initial sync from appearing to get stuck, and client_max_body_size prevents the “413 Entity too large” error. Put CouchDB on its own subdomain, not in a subdirectory.

Back up your data

All databases are stored in the /opt/livesync/data directory. Briefly stop CouchDB to create a consistent backup:

Code
cd /opt/livesync
docker compose stop
tar czf livesync-backup-$(date +%F).tar.gz data livesync.ini docker-compose.yml .env
docker compose start

The archive also contains your password from .env. Keep it secure and don’t store it only on the VPS.

Update CouchDB

Back up the data directory first. Then enter the new version for the image in docker-compose.yml, such as a newer 3.5.x version, and restart:

Code
cd /opt/livesync
docker compose pull
docker compose up -d

Before upgrading to a new major version, read the CouchDB release notes.

Set Up the Plugin in Obsidian

The server is ready; now you can connect your Obsidian apps. Set up one device completely first, then add your other devices.

Warning: Back up first, and don’t use two sync services

Back up your vault before setting up the plugin. Don’t use LiveSync at the same time as Obsidian Sync, iCloud, or another service that writes to the same vault.

Set up the first device

  1. In Obsidian, open Settings > Community plugins, search for Self-hosted LiveSync, then install and enable it.
  2. Click the Welcome to Self-hosted LiveSync message, select I am setting this up for the first time, and confirm.
  3. Under Connection Method, select Configure a remote manually, then Proceed with manual configuration.
  4. Under End-to-End Encryption, enable encryption and set a strong passphrase (more on this below).
  5. Select CouchDB, then Continue to CouchDB setup.
  6. Enter your connection details: the app address, including https://, the username and password from App environment, and a database name, such as obsidiannotes. The plugin will create the database for you.
  7. Optionally, Check server requirements checks your CouchDB settings.
  8. Click Create or connect to database and continue, then Restart and Initialise Server, and confirm with I Understand, Overwrite Server. For a new database, select Use this device's settings.

Leave Obsidian open until the status bar settles down. Create a test note and check in Fauxton whether the database is growing.

Info: Note about chttpd.enable_cors in the One-Click App

If Check server requirements reports “chttpd.enable_cors is wrong” for the One-Click App, you can ignore it. Obsidian access still works; we’ve checked both desktop and smartphone addresses. Any correction made using the button in the plugin only lasts until the app is reinstalled or updated.

Add more devices with a Setup URI

You don’t need to enter everything again for each additional device, such as your smartphone:

  1. On the first device, open the command palette and run Self-hosted LiveSync: Copy settings as a new Setup URI.
  2. Set a password for the Setup URI and copy the link, which begins with obsidian://setuplivesync.
  3. Install Obsidian and the plugin on the new device. In the welcome screen, select I am adding a device to an existing synchronisation setup, then Use a Setup URI (Recommended).
  4. Paste the link, enter its password, and follow the setup wizard with Restart and Fetch Data. For an empty vault, select Overwrite all with remote files.

Once the data has been fetched, automatic syncing is still disabled on the new device. In the plugin settings, change Sync Mode to LiveSync.

Tip: Store the Setup URI and password separately

The Setup URI also contains your CouchDB credentials in encrypted form. Never send the link and password through the same channel; for example, don’t put both in the same chat message.

End-to-end encryption

When end-to-end encryption is enabled, the plugin encrypts your notes on your device before they reach the server. The CouchDB then stores only unreadable data, so even someone with access to the server can’t see the contents. You can also hide document properties using Obfuscate Properties.

You’ll need the passphrase on every device; the Setup URI transfers it as well. Keep it in a password manager. Without it, you won’t be able to access the data on the server. If you change the passphrase later, the database needs to be rebuilt.

Conflicts

If you edit the same note on two devices before they sync, a conflict occurs. The plugin resolves simple cases on its own when the changes don’t overlap. Otherwise, it lets you compare the versions and choose the right one. Both versions are kept until you make a decision. Merging doesn’t work for images and other binary files, so you’ll need to choose one version.

You’ll have fewer conflicts if all your devices are in LiveSync mode and you leave Obsidian open briefly after making major changes, until syncing is complete.

Limitations

  • Not an official service: LiveSync is a community plugin and doesn’t work with Obsidian Sync.
  • Smartphones require HTTPS: The mobile app won’t connect over plain HTTP. The One-Click App with a domain meets this requirement.
  • Server maintenance is your responsibility: You manage CouchDB updates, backups, and storage space. The database keeps older versions and grows over time.
  • One administrator account: The One-Click App creates only the administrator account. Don’t share it with other people: anyone who knows the credentials can read and delete all databases. End-to-end encryption keeps the contents unreadable, but they can still be deleted.

Conclusion

With Obsidian LiveSync on your VPS, you can sync your notes between all your devices without a third-party sync service and with end-to-end encryption. CouchDB is just the storage running in the background; you continue working in the Obsidian app as usual.

Prefer not to deal with Docker manually? Choose the easy One-Click App option described above under “Easy Option: Obsidian LiveSync as a One-Click App”.

Free tools

Related tools for servers and developers

View all

FAQ

Frequently asked questions

Obsidian is the desktop app that runs on your VPS and is accessed in a browser. Obsidian Livesync is a CouchDB server that the Self-hosted LiveSync community plugin uses to sync notes between Obsidian apps on your PC, laptop, and smartphone. To sync across multiple devices, you need Obsidian Livesync; this app doesn’t include an Obsidian interface.
The One-Click App is the quickest option: CouchDB is available over HTTPS on your domain within minutes, with sign-in and Obsidian access already configured. You can install updates from the dashboard. The manual Docker Compose installation is useful if you don’t use One-Click Apps on your server, want to run CouchDB behind your own reverse proxy, or want to manage every setting yourself.
For the URL, enter your app address with https://. Use the value of SERVICE_USER_COUCHDB as the username and SERVICE_PASSWORD_64_COUCHDB as the password. You’ll find both under the automatically generated values in App environment, accessed from the app card’s gear icon. Choose a database name yourself, such as obsidiannotes; the plugin will create the database.

Feedback

Was this article helpful?

Your feedback helps us prioritize and improve content.

0 of 0 people found this article helpful.

Personal support

Need more help than the guide provides?

Our ZAP-Hosting support team knows your product — briefly describe your issue and we'll help you personally.

Zappy knows this guide and answers you right in the chat.