Set Up Self-Hosted Obsidian Sync with Docker and CouchDB
Job to be done: Set up a self-hosted, real-time sync server for Obsidian notes using Docker and CouchDB
🇳🇬 Ways to use this in Nigeria
Ideas to get you started, adapt to your situation.
- Student
A CS student sets up a private Obsidian sync server on a mini-PC to keep project notes, papers, and lecture summaries in sync across laptop and phone, with no cloud subscription.
- Entrepreneur
A startup founder self-hosts Obsidian sync so product ideas, market research, and pitch notes stay private and available across all their devices.
- 9-5 employee
An IT specialist self-hosts Obsidian sync to keep troubleshooting guides and network configs private and instantly updated across work machines.
What you’ll get
Your own private sync server for Obsidian notes, so your notes update in real time across your laptop, desktop, and phone, with no monthly subscription and your data staying entirely under your control. It runs CouchDB (a database good at syncing) inside Docker on a machine you own, and Obsidian’s LiveSync plugin talks to it. It is intermediate: you use a terminal and a couple of config files, but each is provided.
Tools you need
- Obsidian (freemium): the note-taking app you are syncing.
- Docker (freemium): runs CouchDB in a self-contained “container” so you do not install it by hand.
- CouchDB (free): the database that does the actual real-time syncing.
- Pinggy (free): gives your local server a secure public web address, so your phone can reach it without complex network setup.
- Obsidian LiveSync plugin (free): the Obsidian plugin that syncs your notes to CouchDB.
Steps
-
Install Docker: install Docker Desktop for your system and confirm it works with
docker --versionanddocker compose version. -
Make a project folder:
mkdir obsidian-sync cd obsidian-sync -
Create the config file: make a file named
docker-compose.ymlin that folder (this file describes the CouchDB service):touch docker-compose.yml -
Configure CouchDB: open
docker-compose.ymlin a text editor and paste this, replacing the password with a strong one of your own:services: couchdb: image: couchdb:latest container_name: couchdb-for-ols environment: - COUCHDB_USER=admin - COUCHDB_PASSWORD=your-secure-password-here ports: - "5984:5984" volumes: - ./couchdb-data:/opt/couchdb/dataThis runs the official CouchDB, sets an admin user and password, exposes it on port 5984, and saves its data in a local
couchdb-datafolder so nothing is lost on restart. -
Start CouchDB: from the same folder, run it in the background:
docker compose up -dCheck it is running with
docker ps. -
Open CouchDB: visit
http://localhost:5984/_utils/in your browser and log in withadminand your password. You should see CouchDB’s admin interface. -
Expose it with Pinggy: sign up for Pinggy and start a tunnel to your local CouchDB on port 5984. This gives you a public HTTPS address your other devices can reach securely, without opening ports on your router.
-
Set up the Obsidian plugin: in Obsidian, go to Settings, then Community plugins, search for “Self-hosted LiveSync”, and install and enable it. In its settings, enter your Pinggy CouchDB URL, a database name, and the admin username and password. Repeat on each device so they all sync to the same server.
Original source
Based on a DEV Community guide by lightningdev123, sharing a free, private, self-hosted Obsidian sync setup using Docker and CouchDB after years of using Obsidian.
Notes & variations
- Free-tier alternative: Pinggy’s free tier works; for permanent remote access you could use another tunneling service or your own VPN if you have a static IP.
- Common pitfall: a weak or exposed CouchDB password. Always use a strong password and only reach CouchDB through the secure tunnel, or your notes could be exposed.
- Tip for better results: for large vaults or frequent edits, keep an eye on the server’s CPU, memory, and disk. CouchDB is efficient, but performance depends on your hardware.