--- title: Pair and Connect Libraries description: Establish device trust and attach remote library state sidebarTitle: Library Sync Setup --- Pair devices first, then choose which library relationship to establish. Pairing creates device trust. Library setup creates scoped shared state. ## 1. Check networking Run on both devices: ~~~bash sd-cli network status ~~~ Each daemon should report a node ID and active networking. ## 2. Pair the devices On the device that will show the code: ~~~bash sd-cli network pair generate ~~~ On the joining device: ~~~bash sd-cli network pair join "" ~~~ Confirm the peer identity on both sides, then list the paired devices: ~~~bash sd-cli network devices ~~~ ## 3. Inspect libraries List local libraries: ~~~bash sd-cli library list ~~~ Discover libraries exposed by the paired device: ~~~bash sd-cli library sync-setup discover ~~~ Discovery follows the remote device's current grants. An undisclosed library is not evidence that it does not exist. ## 4. Register or create the relationship Run the interactive setup: ~~~bash sd-cli library sync-setup setup --interactive ~~~ The flow supports: - registering an authorized remote library with a local library; - creating shared library state between the two devices; - selecting the source and operation scopes each device receives. For scripting, inspect exact arguments from the installed release: ~~~bash sd-cli library sync-setup setup --help ~~~ Use stable library and device UUIDs. Do not parse display names as identity. ## 5. Confirm state ~~~bash sd-cli library info sd-cli network devices --connected sd-cli sources list sd-cli job list ~~~ Library sync can complete before every remote source is online. Source availability and source-generation replication have their own state. ## What setup does not do Connecting libraries does not: - copy every source generation into the library database; - download all file bytes; - expose ungranted local paths; - turn a remote browse into a backup; - make two devices share unrestricted mutation rights. Remote source serving, source-store subscription, caching, and file sync are separate choices. ## Troubleshooting ### The peer is not discovered Use the QR payload or node ID for internet pairing. Check that both daemons have networking enabled and that the code has not expired. ### Pairing works but discovery returns no libraries Review the remote device's library grant. Pairing proves identity but does not grant every library. ### Metadata appears but files do not open The source store may be cached while its origin is offline, or the grant may allow metadata but not bytes. Inspect source availability and subtree scope. ### A job remains after reconnect Query the job on the device executing it. Durable jobs remain owned by that daemon and can outlive the client connection. See [Device Pairing](/core/pairing), [Library Sync](/core/library-sync), and [File Sync](/core/file-sync).