Run your own relay
Install the Cinnabar sync relay on a Linux server, give it a public wss:// address, and add your owner id to its list.
Cinnabar’s devices sync through a relay. The relay stores your changes encrypted, passes them between your devices, and can’t read them. It is the relay of Evolu, which Cinnabar is built on, with two additions: a list of the owner ids it accepts, and a limit on how much each may store.
The code and its full instructions are in the repository, under infra/relay.
What you need
- A Linux server with systemd, on x86_64 or arm64, with glibc 2.28 or later (or musl).
- bash 4 or later,
curl,xz-utils, andrsyncon the server. - A user on the server who can
sudo. - A way to give the relay a public
wss://address: a domain name, and either a TLS reverse proxy on the server or a Cloudflare tunnel.
You don’t need Node installed on the server. The install brings its own copy, checked against a pinned hash, and compiles nothing.
Install
From a clone of the repository, on your own computer, copy the relay’s folder to the server and run its two scripts:
rsync -a --delete --exclude /node --exclude /app --exclude /node_modules \
infra/relay/ you@your-server:cinnabar-relay/
ssh you@your-server 'bash ~/cinnabar-relay/stage.sh'
ssh -t you@your-server 'sudo bash ~/cinnabar-relay/install.sh'
stage.sh runs as you and fetches Node and the relay’s packages. install.sh is the one step that needs root. It creates a cinnabar-relay system user, installs everything under /opt/cinnabar-relay, writes a settings file if there isn’t one, and starts the cinnabar-relay service.
To update the relay later, run the same three commands again. Or run one command that does all three, from the clone’s top folder after npm install (it does a first install too):
npm run deploy:relay -- you@your-server --relay wss://sync.example.com
It asks for your sudo password once and runs the three steps. Then it checks that the relay answers at that public address. Add --port <n> if you set CINNABAR_RELAY_PORT to something other than 4000.
The relay listens only on 127.0.0.1:4000, so nothing outside the server can reach it yet.
Give it a public address
Put one of these in front of the relay.
A TLS reverse proxy, such as Caddy, on the server. A Caddyfile for it can be this short, and Caddy gets the certificate itself:
sync.example.com {
reverse_proxy 127.0.0.1:4000
}
Allow only ports 443, 80, and SSH through the server’s firewall.
A Cloudflare tunnel, which needs no open port. Your domain on Cloudflare’s free plan is enough. On the server, sudo bash ~/cinnabar-relay/tunnel.sh installs cloudflared and prints the commands that create the tunnel; then sudo bash ~/cinnabar-relay/tunnel.sh sync.example.com sets it up as its own service. The relay’s README has the details, including a rate limit and what to do if the hostname is behind Cloudflare Access.
Your relay’s address is then wss://sync.example.com.
Add your owner id
The relay refuses every account whose owner id isn’t on its list.
- In Cinnabar, turn on sync with your relay’s address.
- In Settings → Sync, copy the Owner id. It names your account to the relay and reveals nothing of your recovery phrase. All devices on one account share it.
- On the server, add it to
CINNABAR_RELAY_OWNERSin/etc/cinnabar-relay/env. Separate several with commas. - Restart the relay:
sudo systemctl restart cinnabar-relay.
Until the relay lists your owner id, Settings → Sync shows Can’t reach relay: the relay is refusing an account it doesn’t know yet. That is expected between steps 1 and 4. The Owner id and its Copy button are just below.


The app’s sync status should then change to Synced.
The settings file has three settings:
| Setting | Default |
|---|---|
CINNABAR_RELAY_OWNERS |
None: every account is refused |
CINNABAR_RELAY_MAX_OWNER_BYTES |
104857600 (100 MB per account) |
CINNABAR_RELAY_PORT |
4000 |
If a setting can’t be read, the relay stops and logs why. Read the log with journalctl -u cinnabar-relay.
Check it works
systemctl status cinnabar-relayshows the service as active. The first line of its log says how many owner ids it lists.curl -s https://sync.example.com/healthanswers{"status":"ok"}.curl -s https://sync.example.com/versionanswers the Evolu protocol and version the relay runs, for example{"protocol":1,"evolu":"8.27.2"}.- From another machine,
nc -vz -w 5 your-server 4000gets no connection.
A connection with an owner id that isn’t listed gets a 401 response. If the app says Can’t reach relay, check the address and that the owner id is listed.
Keep it in step with the app
The relay and the app must speak the same Evolu protocol. If they don’t, the app’s sync status says Update needed, and the device keeps its changes until both match; nothing is lost. The relay in the repository is pinned to the Evolu version the app at the same commit uses, so keep your relay up to date with the repository’s main branch. When a new Evolu version changes the protocol, update the relay first; devices sync again as each one updates.