# Connect to Calibre

> Point Books & Shelves at Calibre's Content Server, and decide whether it may write to your library.

Books & Shelves reaches your library through Calibre's own Content Server.

## Steps

1. In Calibre, select **Connect/share → Start Content server**.
2. In Obsidian, open **Settings → Books & Shelves → Library** and select **Connect…**.
3. Fill in the dialog:

| Field | What to enter |
|---|---|
| **Content Server address** | Where the server listens. By default `http://localhost:8080`. |
| **User** and **Password** | Only when the server asks for a login. The password is kept in Obsidian's keychain. |
| **Library** | The library's ID on that server. Leave empty for the server's default. |
| **Library folder** | Optional. The folder of your Calibre library, the one holding `metadata.db`. With it, Books & Shelves can still read the library when the server is off. |

4. Select **Test**, then **Done**.

## The settings Calibre needs

**Test** checks each of these against the server and, for any that is set wrong, says where to set it in Calibre. The Library tab shows the same: *Connected* when all pass, *Connected, read-only* when only the last fails, with the fix in the row's description.

| Check | What it needs | Where in Calibre |
|---|---|---|
| **Content Server** | The server is running at the address above. | **Connect/share → Start Content server**. To have it start every time: **Preferences → Sharing over the net → Main → Run server automatically when calibre starts**. |
| **Login** | No login, or a user and password that the server accepts. | **Preferences → Sharing over the net → Main → Password based authentication to access the server** (off), or **User accounts** to add one and enter it in the dialog. |
| **Library** | The library in the dialog is one the server offers; empty means the server's default. | Open the library in Calibre, then stop and start the server. |
| **Changes** | The server lets this connection make changes. Needed to write metadata and covers back, and to convert a book (the conversion adds an EPUB to it). | **Preferences → Sharing over the net → Advanced → Allow un-authenticated local connections to make changes**, then **Apply** and stop and start the server. For a server on another machine: **Allow un-authenticated connections from specific IP addresses to make changes**, or log in as a user who may. |

The *Changes* check sends one `set_metadata` command that only reads field names; Calibre refuses it before doing anything when changes aren't allowed, so the check never changes your library.

Without *Changes*, everything still works except writing accepted changes back and converting books.

## When the server is off

With a **Library folder** set, the library is read straight from `metadata.db`, read-only. Syncing notes works. Book files, covers from Calibre and writing to Calibre wait until the server is on.

## Related

- [Sync notes from Calibre](sync-notes.md)
- [Changes to Calibre, and undo](changes-to-calibre.md)
