Obsidian is a fantastic note-taking tool that really clicked with me in ways that no other has before, and I can't even quite put my finger on why. It has so many customization options, is simple and easy to use, and it gives users a staggering amount of control. It gives users so much control, in fact, that you can easily host your own alternatives to Obsidian Sync, one of the few paid options that this tool offers. Thanks to my home server and a free Obsidian plugin, I now have a live, self-hosted alternative to Obsidian Sync that works perfectly.
To get this set up, you'll need a way to deploy a couple of Docker containers, and preferably, you'll need a way to access your home server from elsewhere. I'm using Tailscale for that, but any remote access system will work. This will still work without a way to access your home server remotely, but your notes won't sync to the server until you're back on the same network. While others may use Git or Syncthing for notes syncing, this is by far the best option that I've tried so far.
Introducing CouchDB and LiveSync
Two free services
CouchDB is an open-source document-oriented NoSQL database, with every iteration of a document being versioned. For Obsidian, it's perfect, as your notes can all be created as documents, with the LiveSync plugin capable of inputting your notes into the database, while retrieving and interpreting those documents for insertion back into Obsidian. The result is a system that is arguably better than Obsidian Sync, while being completely free and relying on your own hardware to do it.
LiveSync has a lot of useful options for synchronizing your Obsidian with other devices, and even works on mobile, too. I have it set up on my phone, laptop, and PC, and my notes appear instantly on all of them when I only add a note on one of them. It was super easy to set up, and has been one of the best benefits of my home server. When I need to take down a note when I'm out, I'll either use Blinko or I'll add it to an existing note with Obsidian, and either way, I can then see what I added on my PC or my laptop.
For Obsidian users, this is a must-have. It's free, it's self-hosted, and on TrueNAS, you can easily integrate it as part of your cloud backups if you want to. I'm using Dockge to deploy the Docker container that CouchDB runs in, but any platform that allows you to use a Docker Compose file will work.
How to set up CouchDB and Obsidian
The longest part of the process
First and foremost, this was made possible thanks to /u/Timely_Anteater_9330's post on /r/selfhosted, and we'll be using their Docker Compose to deploy this service. If you aren't using Unraid, you can remove the "labels" section of the compose file, and on TrueNAS with Dockge, I created a dataset for storing the CouchDB files and modified the volumes section to point to those. In my case, my volumes look like this, but yours may look different:
- /mnt/Storage/configs/CouchDB-Obsidian/data:/opt/couchdb/data
- /mnt/Storage/configs/CouchDB-Obsidian/etc/local.d:/opt/couchdb/etc/local.d
I removed the labels section, and also set the PUID and UID to 1000 and 1000.
Once your container is up and running, you can navigate to CouchDB by going to http://
Next, create the database. You'll want to make a database per user, so in my case, mine is just "obsidiandb", but you may opt for another naming convention in order to differentiate between your databases. Ensure that the "partitioning" option is set to "non-partitioned", and you'll then be redirected. The next step is to enable the database to work with LiveSync. You'll need to create the following settings, taken from the couchdb-init.sh script on the LiveSync GitHub. You can do this by going to Configuration on the left menu, and then clicking the Add option button for each of them.
- Section: chttpd, Name: require_valid_user, Value: true
- Section: chttpd_auth, Name: require_valid_user, Value: true
- Section: httpd, Name: WWW-Authenticate, Value: Basic realm="couchdb"
- Section: httpd, Name: enable_cors, Value: true
- Section: chttpd, Name: enable_cors, Value: true
- Section: chttpd, Name: max_http_request_size, Value: 4294967296
- Section: couchdb, Name: max_document_size, Value: 50000000
- Section: cors, Name: credentials, Value: true
- Section: cors, Name: origins, Value: app://obsidian.md,capacitor://localhost,http://localhost
Note that in the "origins" field for cors, you'll also want to add any other IP addresses or domains that you intend to access it from. While not recommended, you can also go to the CORS section on the left of your configuration and disable it entirely. This is a security feature that should be left on, though.
Finally, install the LiveSync plugin from the Obsidian community plugins section and enable it. You can then go to configure it. While there is a Connect with setup URI option, this didn't work for me, and I'd suggest going to the fourth tab (with the little satellite icon, pictured above) and manually configuring it. Make sure CouchDB is selected, and use the same username and password that you used when configuring the server. Finally, the database should match the database name in CouchDB. Click Test, and it should work! You can also click Check to ensure that everything is configured correctly, and it may make some suggestions for things to fix. You can also scroll down and enable end-to-end encryption with a passphrase, which I have enabled on my instance.
Finally, go to the next tab over, and change the sync mode to LiveSync. Everything will now work, and as you type, your data will be synced to the CouchDB server so that it can then be shared with other devices that also have access to your database. I've only experienced one issue that I couldn't really figure out the cause of, but the solution was to simply restart the CouchDB container. I've been using it for weeks, and that only happened once, so I'm pretty happy with the performance and robustness of this particular setup.
5 Obsidian plugins to make your vaults visually appealing
Transform your Obsidian aesthetics in no time
Syncing your notes doesn't have to be hard
There are lots of options to do it
There are a few ways to sync your notes, and this is merely one of them. You can use Git, you can use Syncthing, and you can even do something a little more rudimentary through a tool like Google Drive. However, I like the live nature of this particular tool, and the fact that I can write on my phone and have it instantly accessible on my laptop or PC. There may be more setup involved than some may like, but honestly, it works really well, so I don't mind the amount of time that I spent on it, given what I got out of it.
This is also why I love Obsidian, as the level of control granted to users is impressive. You can do what you want; there's nothing stopping you from setting up a convenient alternative to one of its only paid services, and that's a great move to do right by users. Obsidian is one of the best note-taking apps, and this made it even better for me.
