docker-compose-collection/obisidian-livesync/README.md

3 KiB

Obsidian LiveSync with CouchDB

This configuration sets up a CouchDB container for Obsidian LiveSync with Traefik as a reverse proxy.

Prerequisites

  • Docker & Docker-Compose
  • Traefik as a reverse proxy
  • A configured .env file with the required environment variables

Environment Variables

Copy .env-example to .env and adjust the values accordingly.

local.ini Configuration

Modify the file data/local.ini:

[admins]
admin = <SECRET_PASSWORD>

Starting the Container

Run the following command to start the container:

docker-compose up -d

Testing the CouchDB Connection

  1. Via Browser (Fauxton UI):

    http://your.domain.com/_utils/
    
  2. Using cURL:

    curl -u ${OBSIDIAN_COUCHDB_USER}:${OBSIDIAN_COUCHDB_PASSWORD} http://your.domain.com:5984/
    

Configuration of Endpoint Device using the LiveSync Plugin

One final step is needed to complete the setup: configuring the LiveSync plugin on any Obsidian client that will be part of the data synchronization process.

Installing the plugin inside Obsidian is simple:

  1. Go to the plugin section.
  2. Search for the Self-hosted LiveSync plugin.
  3. Install and enable the plugin.

Once installed, the plugin needs to be configured. There is a quick wizard on the GitHub page of the plugin that describes the process in detail.

Configuring the Remote Database

The most important step is setting up the Remote Database configuration. This is the actual Docker container, which should be accessible over an HTTP or HTTPS address, depending on the setup.

Remote Database Configuration

As shown in the image above, the URI parameter should point to the CouchDB container. The example shows a local address and the default database port. If using a reverse proxy, replace this with an HTTPS URL.

  • Username and Password: These are the credentials defined in the docker-compose file.
  • Database Name: This is a user-defined name. If the database does not exist, Obsidian will create one automatically.

Enabling End-to-End Encryption

E2E encryption of the database is supported and recommended. Be sure to configure this for additional security.

Encryption Configuration

Finalizing the Setup

This configuration must be repeated on all devices that will participate in synchronization. Any changes on one device will be automatically pushed to the CouchDB sync database and then forwarded to all other connected Obsidian clients.

If everything is working correctly, a sync status icon should appear in the upper right corner of the Obsidian app.

This setup provides a fast and stable self-hosted Obsidian sync solution. However, keep in mind that maintenance, plugin updates, and LiveSync Docker container updates are the responsibility of the end user.