Table of Contents
A private, end-to-end encrypted synchronization server for Obsidian, powered by Apache CouchDB and Docker, hosted locally on an Ubuntu server environment.
This repository contains the configuration files and documentation for a self-hosted synchronization backend designed specifically for the Obsidian Self-Hosted LiveSync plugin.
Instead of relying on third-party cloud storage or commercial sync services, this stack gives you complete ownership and control over your personal knowledge base while enabling seamless, real-time multi-device synchronization.
- 100% Data Sovereignty: Your notes never leave your local network or infrastructure. Everything resides within your own Docker volumes and CouchDB database.
- End-to-End Encryption (E2EE): Data is encrypted on your client device before it is sent to the server. Even if the server were compromised, your notes remain completely private and unreadable.
- Real-Time Sync via LiveSync: Utilizes database change feeds to push and pull updates across your desktop and mobile devices instantly as you type.
- Lightweight & Containerized: Built using Docker Compose, making it trivial to deploy, back up, migrate, or spin up on alternative hardware (such as an old laptop or home server running Ubuntu).
A self-hosted, containerized backend infrastructure using Apache CouchDB and Docker to provide real-time synchronization for Obsidian vaults across multiple devices.
- OS: Ubuntu (running on local server hardware)
- Containerization: Docker & Docker Compose
- Database: Apache CouchDB (configured for persistent local storage and CORS access)
- Client Plugin: Obsidian Self-Hosted LiveSync
- Zero Cloud Reliance: Complete data ownership. No third-party servers, subscription fees, or hidden telemetry tracking your personal knowledge base.
- True End-to-End Encryption: Notes are encrypted locally on your client device before touching the server, ensuring absolute privacy.
- Instantaneous Multi-Device Sync: Leverages database change streams so your notes update across devices in real time as you edit.
Before you begin setting up the synchronization server, ensure you have the following ready:
- A Server Environment: A dedicated machine or old laptop running Ubuntu (or any Linux distribution capable of running Docker).
- Obsidian: Installed on your client devices (Desktop and/or Mobile).
- Obsidian Self-Hosted LiveSync Plugin: Installed via Obsidian's Community Plugins menu (make sure to enable community plugins in your vault settings).
- Docker & Docker Compose: Installed and running on your host machine. You can verify this in your terminal by running:
BASH
# Verify the installation
sudo docker --version
sudo docker compose versionFor secure, up-to-date installation steps tailored to your specific version of Ubuntu, please refer to the official documentation:
- Official Docker Engine Installation Guide for Ubuntu
- Docker Compose Installation Guide
- Tip: Ensure your user account is added to the
dockergroup or usesudofor container commands.
Follow these steps to configure and run your self-hosted CouchDB server using Docker Compose.
On your Ubuntu server, create a dedicated directory for your sync stack and navigate into it:
BASH
mkdir obsidian-couchdb-sync
cd obsidian-couchdb-syncCreate a docker-compose.yml file in your project directory with the following configuration:
YAML
version: '3.8'
services:
couchdb:
image: couchdb:latest
container_name: couchdb-sync
restart: unless-stopped
ports:
- "5984:5984"
environment:
- COUCHDB_USER=${COUCHDB_USER}
- COUCHDB_PASSWORD=${COUCHDB_PASSWORD}
volumes:
- couchdb_data:/opt/couchdb/data
- ./local.ini:/opt/couchdb/etc/local.d/local.ini
volumes:
couchdb_dataThe Self-Hosted LiveSync plugin requires specific CouchDB configurations (such as enabling CORS and adjusting cluster settings) to communicate properly.
Create a local.ini file in the same directory:
TOML
[couchdb]
single_node = true
max_document_size = 50000000
[httpd]
enable_cors = true
bind_address = 0.0.0.0
[cors]
origins = *
credentials = true
headers = accept, authorization, content-type, origin, referer
methods = GET, PUT, POST, HEAD, DELETE
[chttpd]
require_valid_user = trueStart your CouchDB container in detached mode using Docker Compose:
BASH
sudo docker compose up -d
sudo docker compose psOnce your CouchDB server is successfully running and accessible over your local network or VPN, configure your Obsidian clients to connect to it.
- Open Obsidian on your client device (Desktop or Mobile).
- Go to Settings > Community plugins and ensure they are turned on.
- Click Browse, search for Self-Hosted LiveSync, and click Install.
- Once installed, click Enable.
- Open the plugin settings for Self-Hosted LiveSync.
- Set up the connection URI pointing to your server's IP address and port:
http://<YOUR_SERVER_IP>:5984
- Enter the administrator credentials you defined in your .env file (COUCHDB_USER and COUCHDB_PASSWORD).
- Create a unique database name for your vault sync (e.g., obsidian-vault-name).
- Choose your preferred synchronization mode (typically LiveSync or periodic sync depending on your preference).
- Perform the initial database setup and migration check:
- If setting up a new vault on a secondary device, pull the data from the server.
- If pushing your primary vault for the first time, choose the option to upload your local vault to the remote database.
- Verify that changes sync seamlessly across your devices.
Manage, back up, and monitor your synchronization stack efficiently using standard Linux utilities and Docker Compose commands from your project directory.
Start Services:
BASH
sudo docker compose up -dStop Services:
BASH
sudo docker compose downRestart Services:
BASH
sudo docker compose restartView Real-Time Container Logs
BASH
sudo docker compose logs -fCheck Container Status and Health
BASH
sudo docker compose psCheck Disk Space Usage
BASH
sudo du -sh /var/lib/docker/volumes/* 2>/dev/nullDatabase Backups
CouchDB data is safely persisted inside the couchdb_data Docker volume. To back up your database, you can export or snapshot the volume data periodically, or use CouchDB's native replication/backup APIs.
Distributed under the MIT License. See LICENSE.txt for more information.