Self-Hosting an Obsidian Relay Server


TL;DR

  1. Determine the URL for your self-hosted server.
  2. Download and install the Relay Server docker image on a Synology NAS.
  3. Install the Relay plugin in Obsidian.
  4. Create a relay server.
  5. Start sharing folders!

In simplified terms, this is what the final solution looks like:

relay-server-illustration.png

Why do it?

One of key tenets of Obsidian is that "your thoughts and ideas belong to you and deserve complete privacy." Consequently, your data is stored locally, is inaccessible to the Obsidian team, and is end-to-end encrypted when synchronized over public networks. One drawback to this approach is that collaboration with others is hard. The challenge of local-first software is to keep your data close, but not lock it into a single device, allow use of the data without a network, yet allow for seamless collaboration with others, and ensure ownership and control of your own data with security and privacy designed in by default. Obsidian ticks almost all of these boxes, but does not by itself allow for easy collaboration.

Wanderloots created a great video about an Obsidian plugin that can close this gap and allow effective collaboration within Obsidian without compromising its core principles. The Relay for Obsidian plugin achieves local-first collaboration in Obsidian by allowing users to selectively share folders within their vault with others. The Relay service, based on the open-source Yjs project, uses "conflict-free replicated data types" to implement real-time multi-user editing that is very similar to what you see in fully cloud-based solutions like Google Docs. According to System 3, the developers of Relay, this is "true multiplayer for Obsidian".

System 3 acknowledges that sending your data through their relay server is not yet end-to-end encrypted, and you therefore may not want to use their service to relay sensitive information. That said, the relay server code is open-source and can be self-hosted. If you set up your own relay server, then System 3 only handles the authentication of users. Your data will relay directly between your users and your own relay server. I decided to try this out by installing the relay server software in a docker container on a Synology NAS on my local area network. This allows free collaboration between users on my network (including users connecting over my VPN) without granting System 3 any access to my network or data.

What follows is an explanation of how I put this together.

Detailed Instructions

1. Determine the URL for your self-hosted server

2. Install the Relay Server software on your Synology NAS

3. Install the Relay plugin for Obsidian

4. Create a relay on your self-hosted server

5. Start sharing folders privately

Thanks to Daniel at System 3 for helping me get this up and running. For more information on the Relay plugin and the Relay Server, visit System 3 and their GitHub repositories:


Published with the Digital Garden plugin for Obsidian

Hosted by Orbiter on IPFS and Base