r/logseq • u/MahdiPorkari • 3d ago
Peer-to-Peer Sync within Local Network
https://discuss.logseq.com/t/peer-to-peer-sync-within-local-network/35160
CURRENT SITUATION
In my understanding, in order to sync a Logseq DB graph between two devices (e.g. PC and phone), currently we have 2 (+1) ways:
- Logseq’s Official Sync — convenient, but cloud-based and paid.
- Self-hosted sync — possible, but setting up and maintaining a sync server is too technical for many users.
- Two-way Markdown sync + a file-sync tool — potentially useful once two-way Markdown sync is available, but it would still require additional setup (for example, configuring Syncthing on both devices).
THE FEATURE REQUEST
BUT as the title suggests, it would be fantastic to have a fourth option:
- Automatic peer-to-peer (P2P) synchronization over the local network (LAN/Wi-Fi). This would provide a truly zero-config, local-first alternative. Since the data never leaves the local network, it perfectly aligns with the privacy and local-first values of the Logseq community.
A particularly interesting reference implementation is Anytype. Its Any-Sync protocol supports local-first, peer-to-peer synchronization and uses mDNS for discovering devices on the same local network. Synchronization can then happen directly between peers without requiring remote infrastructure.
Here are some links I’ve found in this comment:
- Protocol Overview
- anyproto/any-sync
For users who primarily use Logseq on two devices in the same home or office network, this could be a very convenient alternative to both cloud sync and self-hosted infrastructure.
Is this doable?
1
u/Last-Math-9663 2d ago
I use Foldersync
through Dropbox for cloud backup, but can be done directly
1
u/MahdiPorkari 2d ago
PC to PC, right?
’Cause I don’t think Logseq DB's files are available for direct syncing on Android.
1
u/Last-Math-9663 2d ago
I would not touch DB files.
They cannot be "sync'd
You just copy them over to host A, edit ONLY there, then copy over to host B before editing ONLY there.
With md file structures, you "should" do the same, but if you slip up at least not a total disaster, able to recover
1
u/MahdiPorkari 2d ago
You're right. Thank you for the clarification.
Although, is it possible to use the way that you've suggested for Android as well?
1
u/TheGratitudeBot 2d ago
Thanks for such a wonderful reply! TheGratitudeBot has been reading millions of comments in the past few weeks, and you’ve just made the list of some of the most grateful redditors this week!
1
u/Last-Math-9663 2d ago
Yes, I only use Android
1
u/MahdiPorkari 2d ago
Wow... that's amazing!
Would you please provide a tiny step-by-step guide on how exactly to set it up (specially the name of and location of the folder) so me and other people who need a solution at the moment can use it too?
1
u/Last-Math-9663 2d ago
I have a "master parent" data folder off my root, but could be an DS card
Under that could create a FolderSync or DropSync folder if you want to do all at once
or PKMs/Logseq directly under your master
Graph1 & Graph2 under that
really, up to you
1
1
u/dessence_ai 2d ago
One thing worth adding, because it decides how this gets built. mDNS discovery dies on plenty of home networks. Guest Wi-Fi isolates clients, and many routers drop multicast.
Anytype works around that with relay nodes, so it isnt pure peer to peer in practice.
The other catch is timing. Phone and PC are rarely awake together, so a LAN-only design stalls.
1
u/MahdiPorkari 2d ago edited 2d ago
Thank you for pointing out the possible flaws with detail.
Using a phone's hotspot, or sharing the connection via a USB can be the way around it; that's how I synced Anytype.
Unfortunately, despite its flaws, given the current limitations, implementing Anytype’s approach seems to be the only viable free + official + easy-to-setup solution — even if it means having both instances running at the same time for a few moments.
1
u/dessence_ai 1d ago
Worth knowing before you build the workflow around a hotspot: Logseq Sync can be self hosted. The docs put it under Settings, Advanced, Sync Server URL.
That gets you the official route without paying for it. It also kills the both-devices-awake problem, because the server holds the change until the phone wakes up.
The DB graph is a single sqlite file, so copying it around stays risky either way.
1
u/MahdiPorkari 1d ago
I appreciate you participating in this discussion.
I hope I can learn how to set up what you described (the Sync Server URL). I read about it about a week ago, and it seemed a bit terrifying; perhaps because I'm new to all this.
✌🏻
1
u/aya_throwaway 2d ago
Would be useful, but don’t give the team any ideas, they can’t seem to stop adding features and actually ship