8.3 KiB
Set up peer-to-peer synchronisation
This guide configures a working first device through the ordinary user interface, generates a Setup URI for an additional device, and verifies synchronisation in both directions with explicit peer approval.
Peer-to-peer synchronisation has no central data-storage server containing a copy of the Vault. A signalling relay is still required for peer discovery. The project's public signalling relay avoids the need to provision one for an ordinary setup; a controlled setup can use another Nostr-compatible relay. Vault data travels through the encrypted peer connection, not through the signalling relay.
See How peer-to-peer synchronisation works for the communication model, the public relay policy, and the distinction between signalling and TURN.
Before starting:
- back up both Vaults;
- decide whether to use the project's public signalling relay or another relay reachable by both devices;
- ensure the networks permit a WebRTC connection, or review the P2P troubleshooting guidance;
- disable every other synchronisation service for these Vaults; and
- keep both devices awake and Obsidian open during the initial transfer.
Set up the first device
-
Install and enable Self-hosted LiveSync in the intended Vault.
-
Open onboarding from the
Welcome to Self-hosted LiveSyncNotice. -
Select
I am setting this up for the first time, choose manual configuration, then selectPeer-to-Peer only. -
In
P2P Configuration:- enable P2P;
- select
Use the project's public signalling relay, or enter your own signalling relay URLs; - generate or enter a private Group ID;
- enter a strong P2P passphrase;
- enter a unique name for this device; and
- leave automatic start and automatic announcements disabled until the manual round trip succeeds.
-
Select
Test Settings and Continue. The test joins the signalling relay; it does not require another peer to be online. -
Complete the initialisation and final confirmation on the first device. This initialises the local LiveSync database; P2P has no central remote database to erase.
-
Keep optional features disabled until ordinary note synchronisation works.
-
Open
Self-hosted LiveSync: P2P Sync : Open P2P Statusfrom the command palette. After a P2P profile exists, the P2P ribbon icon provides the same destination. SelectOpen connectionif signalling is disconnected. -
Create an ordinary test note and wait for the local LiveSync progress indicators to clear.
Generate the second-device Setup URI
On the working first device:
-
Run
Self-hosted LiveSync: Copy settings as a new Setup URIfrom the command palette. -
Enter a new Setup URI passphrase.
-
Copy the resulting URI.
Keep the first device online. Store the new URI and its passphrase separately.
Add the second device
-
Install and enable Self-hosted LiveSync in a new or separately backed-up Vault.
-
Open onboarding, select
I am adding a device to an existing synchronisation setup, and choose the recommended Setup URI method. -
Enter the Setup URI generated by the first device and its passphrase.
-
Select
Restart and Fetch Data. -
For a new or empty Vault, choose
Overwrite all with remote files, thenKeep local files even if not on remote. Review the Fast Setup guide before using a Vault which contains local work. -
In
P2P Rebuild, confirm that the expected first-device name is shown, then selectSync. -
On the first device, verify the requesting device name and select
Accept. UseAccept Temporarilyinstead when approval should last only for this Obsidian session. -
Keep both devices open until the test note appears on the second device.
Verify the return journey
Create a second ordinary note on the second device. Keep automatic announcements disabled and prove the next finite synchronisation explicitly:
-
Open
P2P Statuson both devices. -
If a peer no longer appears, select
Disconnectand thenOpen connectionon the first device, followed by the second device. The device which joins last is advertised to devices which are already in the room. -
On the first device, select
Refresh, verify the second-device name, then selectReplicate now. -
On the second device, verify the requesting first-device name and select
AcceptorAccept Temporarily. -
Confirm that the second-device note appears unchanged on the first device.
The two devices are now proven to share the same room, encryption settings, and data format in both directions.
After this manual path works, configure automatic behaviour deliberately:
Announce changeson a source device dispatches change notifications while it is connected.Follow changeson the receiving device fetches after notifications from that peer.- The peer's
More actionsmenu can synchronise or follow whenever that named device connects, or include it in the P2P synchronisation command.
An announcement contains no Vault data and does not transfer a change by itself. The source must announce, the receiver must follow, and both devices must be connected.
If a peer does not appear
- Confirm that both panes show
Connectedand the same Room ID suffix. - Select
Refreshafter the other device joins. - Reconnect the device which should be discovered last.
- Check that the Setup URI came from the working first device and that neither device copied a peer name manually.
- Check signalling relay reachability separately from WebRTC connectivity.
- Review VPN and TURN options in Peer-to-Peer Synchronisation Tips.
Controlled or self-hosted bootstrap
The ordinary route above starts in the plug-in UI and can use the project's public signalling relay. For a controlled deployment, prepare your own Nostr-compatible relay and enter it in Signalling relay URLs on every device.
The public Setup URI generator is also available when configuration must be created outside Obsidian. Run it from a trusted terminal:
export remote_type=p2p
export p2p_relays=wss://relay.example.com
export p2p_room_id=<A PRIVATE ROOM ID> # Optional; generated when omitted
export p2p_passphrase=<A PRIVATE P2P PASSPHRASE> # Optional; generated when omitted
export passphrase=<A STRONG VAULT ENCRYPTION PASSPHRASE>
export uri_passphrase=<A SEPARATE SETUP URI PASSPHRASE>
deno run --minimum-dependency-age=0 --allow-env https://raw.githubusercontent.com/vrtmrz/obsidian-livesync/main/utils/setup/generate_setup_uri.ts
The generated Setup URI contains the encrypted room, relay, and Vault settings. It deliberately omits the device-specific name. Store the URI and its passphrase separately. After importing it on the first device, continue from the initialisation step above, then generate a fresh Setup URI for an additional device from that working device.













