Syncing Obsidian Vaults Peer-to-Peer with Syncthing
Learn how to connect your PC and mobile devices directly using Syncthing for a seamless, private, and instantaneous note-taking experience without relying on cloud services.
Why Syncthing?
Obsidian works on top of local Markdown files, making it highly customizable and offline-first. However, keeping files synced across multiple devices normally requires a paid subscription or a cloud provider.
Syncthing offers a secure, decentralized alternative:
- Peer-to-Peer (P2P): Data is encrypted and transferred directly between your devices. No third-party servers.
- Instantaneous: Changes on one device sync to the other almost immediately when they share a network.
- Cost-Free: Completely open-source and free to use.
Step-by-Step Configuration
1. Pair Your PC and Mobile Phone
Before sharing files, your PC and phone need to establish a secure handshake:
- Install the Apps: Download and run Syncthing on your PC, and Syncthing-fork from the Google Play Store on your Android phone.
- Locate the Device ID: On your PC Syncthing interface (accessible at
http://localhost:8384), click Actions in the top-right corner and select Show ID. This will display a unique string of characters and a QR code. - Scan from Mobile: Open Syncthing-fork on your phone, go to the Devices tab, tap the
+icon, and scan the QR code displayed on your PC screen. Give the device a name (e.g., "My PC") and tap save. - Accept Connection: A prompt will appear on your PC asking to add your phone. Click Add Device and save it.
2. Share the Vault Folder from PC
Once your devices are paired, share your vault folder:
- Add the Folder: On the PC Syncthing dashboard, click Add Folder under the folders section.
- Configure General Settings:
- Folder Label: Choose a name (e.g., "Obsidian Vault").
- Folder Path: Paste the absolute path to your local folder on your PC (for example,
D:\Projects\personal_website_2).
- Share with Phone: Click the Sharing tab in the edit dialog, check the box next to your mobile device's name, and click Save.
3. Accept the Folder and Configure Mobile Path
Now, prepare the folder on your phone:
- Locate the Invitation (via Web GUI): Android system notifications can sometimes delay incoming requests. To bypass this, open Syncthing-fork on your phone, swipe open the left menu sidebar, and select Web GUI. You will instantly see a green prompt at the top of the interface: "New Folder: personal_website_2 (shared by [PC-Name]). Add?" Tap Add.
- Set the Storage Path: In the configuration menu, tap Folder Path. Choose a directory in your internal storage. For Obsidian to read it properly, enter the path like this:
(Note: The prefix/storage/emulated/0/Documents/Obsidian/personal_website_2
/storage/emulated/0/is simply the Android operating system's technical term for the root of your phone's Internal Storage). - Toggle Permissions: Ensure the folder type is set to Send & Receive so edits sync both ways, then tap the check mark in the top-right corner to save.
- Open in Obsidian: Open Obsidian on your phone, select Open folder as vault, navigate to the directory you just configured, and load it.
Sync Settings: Avoiding Layout and Plugin Conflicts
By default, Obsidian saves all your themes, hotkeys, and community plugins inside a hidden folder called .obsidian/. If you sync this folder completely, your PC and phone will continuously fight over layouts and window configurations.
To prevent this:
- Complete the First Sync: Let the very first synchronization complete fully so your phone receives your initial plugins and configurations.
- Apply the Ignore Patterns on Both Sides: Once the first sync is finished, add the ignore rules to both devices to stop them from updating each other's configurations.
Here are the detailed steps for both devices:
How to Add Ignore Patterns on Your PC
- Open the Syncthing dashboard in your PC browser (
http://localhost:8384). - Locate the shared folder under the Folders section and click on it to expand it.
- Click the Edit button at the bottom of the expanded section.
- Select the Ignore Patterns tab from the top menu.
- Paste the following ignore rules into the text area:
// Ignore local Obsidian configuration (maintains separate layouts/plugins).obsidian.obsidian/**
- Click the blue Save button.
How to Add Ignore Patterns on Your Phone (via Mobile Web GUI)
- Open Syncthing-fork on your phone.
- Swipe open the left menu sidebar and select Web GUI to access the web panel.
- Tap on the shared folder in the Folders list to expand it, then tap Edit.
- Select the Ignore Patterns tab.
- Paste the exact same rules into the text box:
// Ignore local Obsidian configuration (maintains separate layouts/plugins).obsidian.obsidian/**
- Tap the blue Save button at the bottom of the dialog.
⚠️ Important: You must add these ignore patterns to both sides. This ensures both devices ignore each other's configurations, completely preventing any settings, workspace layouts, or plugin conflicts.
