# Sync with your server or NAS

Keep your library on your own server or NAS, and Teserra keeps your Macs in sync, with no Teserra cloud. Every setting, every message, and the setup of each storage.

*New in 1.3.14Written from Teserra 1.3.16.*

**In short**

1. Open **Settings → Sync** and enter the WebDAV address of an empty folder, your username and password.
2. **Test connection**, then **Connect**.
3. On your other Mac, the same address and password: the button becomes **Use “Studio”**, with your library's name.

## Choose where your library lives

Your library is a folder. It can live:

- **On this Mac.** The default, ~/Pictures/Teserra. You can turn on sync later.
- **In iCloud Drive.** Put the library in a folder of iCloud Drive, and iCloud keeps it in sync: your other Macs and Teserra for iPhone open that folder. Nothing to set up. At first launch, **Change** next to **Library folder** picks it. *(new in 1.3.19)*
- **On your server or NAS.** Keep the library on this Mac, then **Connect your server**, below, links it to your storage.

> **A library in iCloud Drive** is already kept in sync by iCloud, so Settings → Sync offers no server for it. To use your own server instead, move the library to a folder outside iCloud Drive.

## Connect your server *(new in 1.3.16)*

In **Settings → Sync**:

1. **Choose your server**: Your own server, Synology, QNAP, Nextcloud, Hetzner Storage Box, pCloud, Koofr, kDrive, or Another WebDAV server. A Synology, a QNAP or a WebDAV server that announces itself on your home network shows first, under **Found on your network**: **Use it** fills in its address.
2. Follow the steps Teserra shows for it, where WebDAV is turned on. The address is filled in as far as Teserra can; check the folder at the end. Teserra creates the folder if it does not exist yet.
3. **Username** and **Password**, or **App password** for Nextcloud, Koofr and kDrive. The password stays in your Mac's Keychain. For Nextcloud, give the address you open Nextcloud with, your username and a folder: Teserra builds the WebDAV address.
4. **Test connection**, then **Connect**. Your library is copied there, and the sidebar shows the progress. **All servers** takes you back to the list.

![Settings, Sync: Choose your server, with Your own server on top, then Synology, QNAP, Nextcloud, Hetzner Storage Box, pCloud, Koofr, kDrive and Another WebDAV server.](https://teserra.app/assets/docs/sync-picker.webp)
*Choose your server*

![Synology chosen: the three steps on the NAS (install WebDAV Server, enable HTTP on port 5005, create a shared folder), then Address, Username, Password, Test connection and Connect.](https://teserra.app/assets/docs/sync-synology.webp)
*Synology: its steps, then four fields*

The first time Teserra reaches an address on your home network, macOS asks whether it may find devices on your local network. Allow it: without it, Teserra cannot reach a NAS or a server at home.

### What Test connection tells you

It looks at the folder before Teserra writes anything.

| Message | What it means |
| --- | --- |
| Connected. Teserra will create this folder and copy your library there. | The folder does not exist yet. Connect creates it. |
| Connected. Your library will be copied there. | The folder is empty. |
| Connected. This folder already holds this library: Teserra brings both sides together. | You connected this library before, from this Mac or another one. |
| This folder holds your library “Studio”. Use it on this Mac: its files download here and stay in sync. | The library on this Mac is empty: the button becomes Use “Studio”. See Another Mac below. |
| This folder holds another Teserra library (“Archive”). Choose another folder. | Each library needs its own folder. |
| This folder isn't empty. Choose an empty folder, or a new one: Teserra creates it. | Teserra never writes into a folder that holds other files. |
| The server refused the sign-in. Check the username and password. | Some services want an app password here, not your main one. |
| Can't reach this address. Check it, and that the server is on. | Wrong address or port, or the server is off. |
| macOS is keeping Teserra off your local network. Allow it when macOS asks, or turn Teserra on in System Settings → Privacy & Security → Local Network, then try again. If Teserra isn't in that list, quit it and open it again. | Teserra needs the Local Network permission to reach a NAS or a server at home. Open System Settings, next to the message, opens that pane. |
| This server's certificate isn't trusted (often a self-signed one, the default on many NAS). Use its http:// address at home, or give it a valid certificate. | A certificate Teserra cannot accept as it is. See A NAS with its own certificate, below. |
| This certificate isn't the one you trusted. | The certificate changed since you trusted it. If you replaced it, disconnect and connect again to trust the new one. |
| This address doesn't answer like a WebDAV server. | Something answers, but not WebDAV: check the path after the port. |

### A NAS with its own certificate *(new in 1.3.16)*

Teserra accepts the https certificates your Mac trusts. Most NAS ship with a certificate they made themselves, which no one vouches for: Test connection then shows **This NAS made its own certificate**, who it was issued to and its SHA-256 fingerprint.

- **Trust this certificate** keeps that exact certificate for this storage. If it ever changes, Teserra stops syncing and asks you again.
- **Use http:// at home instead** switches to the NAS's plain address on your own network.

Connecting before choosing says “Trust this server's certificate first, or use its http:// address.”

## Once connected

Settings → Sync shows where things stand, with **Sync now** and **Pause**. While paused, changes stay on this Mac until you **Resume**. Below:

- **Your storage**, with the number of files on it, and **Disconnect…**: Teserra stops syncing this library. Nothing is deleted: your library stays on this Mac, and its copy stays on your storage.
- **Away from home**: a second address, see [below](#away).
- **What syncs**: your files and everything attached to them: tags, collections, notes, ratings, the trash. Search data is rebuilt on each Mac, so nothing heavy travels twice.
- **Devices**: **Connect a device…** shows a code that sets up your iPhone or another Mac, see [Your iPhone](#iphone). Not while sync is paused.
- **Details**: the address and the username in use.

Teserra syncs on its own: when it opens, a few seconds after a change, every five minutes, and when you click Sync now.

### The line in the sidebar

At the foot of the sidebar, above the library name, one line says where sync stands.

![The sidebar's Sync stopped bubble: DiskStation refused the sign-in, check the username and password in Settings, Sync, with Open settings and Try again.](https://teserra.app/assets/snips/sync-stopped.webp)
*When sync stops, the bubble says why and offers the next step.*

| It says | What to do |
| --- | --- |
| **Up to date** | Click to open Settings → Sync. |
| **Syncing 12 items** | With a bar and the percentage done. |
| **Sync paused** | Click to resume. |
| **Can't reach Home NAS** | Your changes stay on this Mac and are sent as soon as it is back. Click for Open settings or Try again. If macOS is blocking the local network, the bubble says so and offers Open System Settings. |
| **Sync needs you** | Deletions are waiting for your decision. Click, then Review. |
| **Sync stopped** | Something went wrong; the bubble says what, for instance “Home NAS's certificate changed”. Click for Open settings or Try again. |

## Check before deleting

If one pass would delete more than 20 files, or more than one file in twenty of your library when that is more, Teserra keeps them and the sidebar says **Sync needs you**. Settings → Sync reads **Waiting for you**, and **Check before deleting** explains: if you emptied the trash or removed many items on purpose, allow it; if not, a folder may have been moved or a disk unplugged, so leave it, nothing is lost. **Allow deletions** asks once more before anything goes.

## Another Mac

1. On the other Mac, at first launch, choose **I already use Teserra**, then **On a NAS or a server**. Or start with an empty library (**New vault…** in the vault menu at the foot of the sidebar) and open Settings → Sync. Enter the same address, username and password. *(new in 1.3.19)*
2. **Test connection** finds your library, and the button reads **Use “Studio”**. Teserra restarts, downloads the files, and keeps both Macs in sync from then on.

## Your iPhone *(new in 1.3.17)*

Teserra for iPhone carries your library: browse it, open any original, keep collections for offline, and send screenshots and links to it from any app's share sheet. It is a free public beta on TestFlight.

1. In **Settings → Sync**, click **Connect a device…** next to **Devices**. The window **Connect your iPhone** shows a code.
2. On the iPhone, install Teserra from [teserra.app/iphone](https://teserra.app/iphone): during the beta it opens TestFlight, Apple's app for test versions.
3. Point the iPhone's camera at the code and open it in Teserra. Your library shows up, and what you share from the iPhone lands on your Mac.

![Settings, Sync connected to DiskStation: Up to date, the server row, Away from home with nas.example.com, and the Devices row with Connect a device.](https://teserra.app/assets/snips/devices-row.webp)
*Once your server is connected, Connect a device adds your iPhone or another Mac.*

![The Connect your iPhone window: a pairing code in a viewfinder with DiskStation and 192.168.1.20:5005 under it, three numbered steps, and a note that away from home the iPhone uses nas.example.com.](https://teserra.app/assets/snips/connect-iphone.webp)
*Scan the code with your iPhone's camera and it connects to your server, nothing to type.*

> **The code carries your storage's address and password.** Show it to your own devices only. With a library in iCloud Drive there is no code: on the iPhone, choose **Use an iCloud Drive folder**.

## Away from home *(new in 1.3.16)*

At home, your Macs reach the NAS or server on your network. A MacBook that leaves home needs a second address it can reach from anywhere, in `https://`. Rented storage already has one.

1. In Settings → Sync, click **Set up…** next to **Away from home**.
2. Choose **Tailscale** (recommended: nothing opens to the Internet) or **My own address** (your NAS's remote access, with a valid certificate), and follow its steps.
3. Paste the address. **Test** checks that it leads to the same library without saving anything; **Save** keeps it.

Each Mac tries the home address first, then the away one. **Change…** and **Remove** are next to it.

- **Tailscale.** Install it on your NAS or server and sign in; on a Synology or a QNAP, use its Tailscale package. In the Tailscale admin console, turn on **HTTPS Certificates** (DNS page). Then share Teserra on your tailnet with the command Teserra shows, ready to copy, like `tailscale serve --bg --https=8451 http://127.0.0.1:8080`. The address reads `https://<machine>.<tailnet>.ts.net:8451/teserra`, reachable only by your own devices.
- **Your own address.** Turn on your NAS's remote access, or point a domain of yours at it, and give it a valid certificate, like Let's Encrypt in its settings. Synology QuickConnect does not carry WebDAV.

## Storage by storage

Teserra syncs with any WebDAV server. What do you have? Pick it for its setup. [Every option side by side](https://teserra.app/storage#options), with what we have tested.

### Synology

1. In Package Center, install **WebDAV Server**.
2. Open it, then Settings: tick **Enable HTTP** (port 5005).
3. In File Station, create a shared folder for Teserra, like **teserra**.

Address: `http://diskstation.local:5005/teserra`, your NAS, port 5005, then the shared folder. Your DSM account; two-step verification does not get in the way. In https on port 5006, the NAS's own certificate can be trusted once: see [A NAS with its own certificate](#certificates).

### QNAP

1. Control Panel, Network & File Services, Win/Mac/NFS/WebDAV: on the WebDAV tab, tick **Enable WebDAV**.
2. Note the port it shows.
3. Create a shared folder for Teserra, like **teserra**, and give your account access to it.

Address: `http://nas.local:8080/teserra`, your NAS, the WebDAV port, then the shared folder. Your QNAP account.

### Your own server

A home server, a Mac mini, a Raspberry Pi: one Docker container running rclone's WebDAV server. Teserra shows the same steps, ready to copy.

1. In a new folder, save this as **compose.yaml**:

```
services:
  teserra-webdav:
    image: rclone/rclone:1.75.2
    restart: unless-stopped
    ports: ["8080:8080"]
    volumes:
      - ./data:/data
      - ./config:/config:ro
    command: >-
      serve webdav /data --addr :8080
      --htpasswd /config/htpasswd
```

1. Create your account there:

```
mkdir -p config && htpasswd -B -c config/htpasswd teserra
```

1. Start it:

```
docker compose up -d
```

Address: `http://server.local:8080/teserra`, your server, port 8080, then a folder name. Username `teserra` and the password you gave htpasswd. Already running WebDAV? Use its address.

### Nextcloud

1. Open **Personal settings**, then **Security**.
2. Under Devices & sessions, create an **app password** named Teserra.
3. In Teserra, give the address you open Nextcloud with, like `https://cloud.example.com`, your username, the app password and a folder: Teserra builds the WebDAV address. Your login password is refused when two-step verification is on.

ownCloud and other WebDAV services: **Another WebDAV server**, with their WebDAV address and a folder name at the end.

### Hetzner Storage Box

1. In the Hetzner Console, open your Storage Box, then **Change settings**.
2. Turn on **WebDAV** and **External reachability**, then wait a few minutes.

Address: `https://u12345.your-storagebox.de/teserra`, your Storage Box, then a folder name. Username `u12345` and your Storage Box password.

### pCloud

1. Nothing to turn on: WebDAV works on every pCloud plan.
2. With two-step verification, approve the **New login attempt** email the first time.

Address: `https://ewebdav.pcloud.com/Teserra` for an account in the EU region, `https://webdav.pcloud.com/Teserra` in the US region. Your pCloud email and password.

### Koofr

1. Open **Preferences**, then **Password**.
2. Create an **app password** named Teserra. Koofr shows it only once.

Address: `https://app.koofr.net/dav/Koofr/Teserra`. Your Koofr email and the app password.

### Infomaniak kDrive

1. Open kDrive in your browser: the number after **/drive/** in its address is your kDrive ID.
2. In the Infomaniak Manager, create an **application password**.

Address: `https://123456.connect.kdrive.infomaniak.com/Teserra`, your kDrive ID at the start, then a folder name. Your Infomaniak email and the app password. WebDAV is not available on kSuite Free and Standard.
