Setting up an SFTP Server on Raspberry Pi for Obsidian Sync
Hello everyone! In this post, I want to tell you about my syncing approach in Obsidian, an amazing tool that lets you take notes in plain text Markdown files and link them together like a network of neurons. It’s like having a second brain for storing and connecting your ideas.
I was recently introduced to Obsidian and was excited to explore ways to synchronize my notes across different devices. I ended up settling on a free SFTP-based solution that’s available as a Community Plugin in Obsidian. I’ve been using the solution for a couple of weeks now with good results and thought it would be a great topic to share on my blog.
The Setup
For this setup, I’m using a Raspberry Pi 4 as the SFTP server, the Obsidian SyncFTP Community plugin by Alex Donnan for syncing functionality, and Tailscale VPN (optional for remote connections). Please take a moment to visit Alex’s GitHub page for the SyncFTP plugin and thank him by starring the project if you find it useful.
You’re not limited to using a Raspberry Pi for the server; any computer capable of serving SFTP can be used. But one of the key advantages of this solution is its cost-effectiveness. The Raspberry Pi is an inexpensive, low-power single-board computer that requires minimal electricity, making it a great choice for this application. Additionally, the USB storage is a cheap way to easily take your storage with you and plug it into another device if needed.
For those not familiar with SFTP, it’s a secure file transfer protocol that uses SSH to encrypt the data being transferred. It’s a great choice for this application because it’s secure and easy to set up. You can read more about it on Wikipedia - SFTP.
Steps
Here’s a high-level overview of the required steps:
- Install Raspberry Pi OS on the Pi and enable SSH. If you need guidance on getting started, you can refer to the Raspberry Pi Foundation’s documentation here.
- Create a directory on the Raspberry Pi for your Obsidian sync vault.
- Configure the SyncFTP plugin in Obsidian on the client PC/Mac where you installed Obsidian. For the FTP URL, you can use either the local IPv4 address (e.g., 192.168.1.23), or the domain name of your Raspberry Pi (e.g., if your Pi’s domain name is
myPi
, then you would usemyPi.local
if you’re using Obsidian on Linux or macOS, ormyPi
without .local for a Windows machine). - (Optional) Install Tailscale onto the Pi and onto the device(s) that you want to keep in sync with the remote backup vault. Tailscale has guides for installing it on the Pi here, and Windows here. Once installed, use the domain name of your Raspberry Pi as the FTP URL to ensure your notes can sync remotely when you’re away from home and using the Tailscale VPN.
I’m using a USB stick plugged into the Pi for the sync vault storage, which allows me to easily carry the vault if needed. I’m considering setting up a cron job to automate regular backups to a cloud service for redundancy. If I get around to doing that, I’ll update this post with the steps.
The main limitation I’ve encountered with this solution is that the SyncFTP plugin doesn’t work with the iOS Obsidian app for iPhone. However, if I need to save a note on mobile, I can save it in the iOS Notes app and use iCloud to copy the note to my laptop. Then I can copy the note into my local Obsidian vault and sync it to the remote vault.
I hope this post is helpful to others using Obsidian who are looking for a simple and cost-effective sync solution. Feel free to reach out to me on LinkedIn if you have any questions or suggestions to improve this post.