Skip to main content

Infrastructure Overview

cairn works out of the box with zero infrastructure. Here's when and why you'd want to add your own servers.

Tier Comparison

Tier 0 (Default)Tier 1 (Signaling + Relay)Tier 2 (Server Peer)
SetupNone2 Docker containers3 Docker containers
NAT traversalPublic STUN, best-effortTURN relay, symmetric NATFull
Discovery speed5-30s (DHT/mDNS)<1s (signaling)<1s
Offline messagesNoNoYes (store-and-forward)
Always-on relayNoYesYes
Multi-device syncManualManualAutomatic (hub)
CostFreeFree (Cloudflare) or ~$5/mo VPSSame + storage

Tier 0: Zero Infrastructure

The default. Peers discover each other via mDNS on the local network or DHT over the internet. NAT traversal uses public STUN servers. Works well when peers have public IPs, are on the same LAN, or are behind simple NATs.

Tier 1: Signaling + Relay

Add a signaling server for fast peer discovery and a TURN relay for reliable NAT traversal. Two lightweight Docker containers. Peers connect in under a second, and the relay handles symmetric NATs and corporate firewalls that block direct connections.

Tier 2: Server Peer

Add a server-mode peer alongside signaling and relay. The server peer provides store-and-forward messaging (offline peers receive messages when they reconnect), personal relay capabilities, and acts as a hub for multi-device synchronization.

Decision Flowchart

Use this to determine which tier you need:

Next Steps