Cairn

File sync that keeps everything about your files.

Cairn is open-source, self-hosted file sync with versioned history. A central server keeps every version; clients sync a real filesystem, and symlinks, modes, owners, xattrs, ACLs, capabilities, hard links, sparse files and filename bytes survive the round trip. Files only: no groupware, no app platform.

Download the latest release Source on GitHub

Early. Clients for Linux, macOS and Windows; the server on Linux. It has been through a harsh failure harness and now syncs real trees, but for days, not yet weeks, so keep another copy of anything you put through it. What is and is not there.

What it does

The whole filesystem

Symlinks stay links. Modes, owners, xattrs, ACLs, hard links and sparse layout come back as they were, as far as the operating system and filesystem allow.

Every version

The server keeps the history of every file, and versions share content-defined chunks. Restore a file or export a whole tree as it was; a restore is a new revision, so it can be undone too.

Conflicts keep both sides

Competing edits are merged three-way, and when they cannot be, both versions are kept, with an inbox of the copies waiting for a decision.

A missing disk is not a delete

Mount checks catch a disk that went away, and an empty folder is not a mass delete until proven so: sync pauses and asks.

Only what changed

Incremental scans, and only new chunks are uploaded, not the whole file again. The daemon syncs when something changes here or on the server.

Small and self-contained

Native Rust binaries with embedded SQLite: no database server, no language runtime. A web interface in the server browses, uploads, restores and shares, with public links.

Cairn compared with Nextcloud, Seafile and Syncthing, with sources for every cell.

Promises

These outrank features and speed, and each has failure tests (crash, full disk, lost event, missing mount).

  1. A commit acknowledged by the server is durable, and its chunks were durable first.
  2. A device never erases what it cannot represent.
  3. Arrival order never decides which content survives: competing edits both remain.
  4. A crash never leaves a half-written file at a synced path, and never loses a queued operation.
  5. An empty folder is not a mass delete until proven so.
  6. Sync never traverses a symlink, and path operations cannot be redirected through one.
  7. Every restore creates a new revision, so a restore can be undone too.
  8. Anything skipped is shown with its reason and a recovery action.

Try it

# The server
cairn-server init --data ~/cairn-data
cairn-server serve --data ~/cairn-data      # 127.0.0.1:8733; plain HTTP, so loopback only

# A client
cairn init --server http://127.0.0.1:8733 --token-file ~/cairn-data/token ~/Sync
cd ~/Sync && echo hello > hello.txt
cairn sync

# What happened, and going back
cairn log
cairn history hello.txt
cairn restore hello.txt --at 1
cairn export --at 1 /tmp/as-it-was          # into a new folder; changes nothing else

Beyond one machine, put a TLS-terminating reverse proxy in front, start the server with --behind-tls-proxy, and use an https:// URL. Users, folders, sharing, the daemon and the web interface are in the README.

Download

Every build is on the latest release on GitHub, each file with its SHA-256.

Linux

x86-64. The CLI and daemon, cairn, and the server, cairn-server, as static binaries in one archive.

macOS

Universal. Cairn.app, the tray, and Cairn Sync.app, the sync daemon, both signed.

Windows

x86-64. cairn.exe, the CLI and daemon, and the tray.

A release build keeps itself up to date from releases signed with the project's key, and can be rolled back with cairn update rollback. The server is never updated by itself.

Open source

The server and storage are AGPL-3.0-only. The protocol, engine and client are Apache-2.0, so any client can embed them. The design, its decisions and the build order are in PLAN.md.

A cairn is a lasting stone marker that helps you find your way: storage you can rely on, and a history you can trace back.