Syncthing: Peer-to-Peer File Sync Without a Server
Most file sync tools work the same way: your files go up to a central server, then back down to your other devices. Dropbox, Google Drive, iCloud, even self-hosted Nextcloud — they all depend on a server in the middle. That server is a single point of failure, a storage cost, and something you have to maintain.
Syncthing skips the server entirely. It synchronizes files directly between your devices using a peer-to-peer protocol. No cloud account, no monthly fees, no third-party touching your data. Two devices on the same LAN will sync at full network speed. Two devices across the internet will find each other automatically and sync over an encrypted connection.
It's open source, cross-platform, and has been rock-solid since its first release in 2014.
How Peer-to-Peer Sync Works
Traditional sync tools use a hub-and-spoke model: device uploads to server, server distributes to other devices. Syncthing uses a mesh model where every device talks directly to every other device that shares a folder.
When you edit a file on Device A, Syncthing detects the change (via filesystem notifications or periodic scans), calculates the differences, and pushes them directly to Device B and Device C. There's no intermediate stop. If Device B is offline, Device A holds the changes until B comes back. If A and C are on the same local network, the transfer happens at LAN speed without ever touching the internet.
Device discovery happens through a lightweight global discovery server (run by the Syncthing project). This server never sees your files — it only helps devices find each other's IP addresses. Once connected, all data transfer is direct and encrypted with TLS 1.3.
Syncthing vs the Alternatives
| Feature | Syncthing | Nextcloud | Dropbox | Resilio Sync |
|---|---|---|---|---|
| Architecture | Peer-to-peer | Client-server | Cloud | Peer-to-peer |
| Central server required | No | Yes | Yes (theirs) | No |
| Open source | Yes (MPL-2.0) | Yes (AGPL) | No | No |
| End-to-end encrypted | Yes | No (at rest on server) | No | Yes |
| Web UI for file browsing | No | Yes | Yes | No |
| iOS app | No | Yes | Yes | Yes |
| Android app | Yes | Yes | Yes | Yes |
| Selective sync | No (all or nothing per folder) | Yes | Yes | Yes |
| File versioning | Yes (built-in) | Yes (via Versions app) | Yes (30-180 days) | Yes |
| Max file size | Unlimited | Server-limited | 2-50 GB | Unlimited |
| Monthly cost | Free | Free (self-hosted) | $12+ | Free / $60 one-time |
| LAN sync speed | Full speed | Server-limited | Slow | Full speed |
The key trade-off: Syncthing gives you privacy, simplicity, and zero infrastructure cost. In return, you lose the ability to browse files via a web interface, there's no iOS app, and both devices must be online simultaneously for sync to happen. If you need file access from a browser or want a single always-available copy, Nextcloud or a cloud service is a better fit.
Installation
Syncthing runs on nearly everything. There's no server to set up — you install it on each device you want to sync.
Linux
Most distributions include Syncthing in their repositories:
# Debian/Ubuntu
sudo apt install syncthing
# Fedora
sudo dnf install syncthing
# Arch
sudo pacman -S syncthing
Start it as a user service (not root):
systemctl --user enable --now syncthing
The web UI is available at http://127.0.0.1:8384.
Docker
Useful for headless servers or NAS devices:
# docker-compose.yml
services:
syncthing:
image: syncthing/syncthing:latest
restart: unless-stopped
hostname: my-server
environment:
- PUID=1000
- PGID=1000
volumes:
- /opt/syncthing/config:/var/syncthing/config
- /mnt/data/sync:/var/syncthing/data
ports:
- "8384:8384" # Web UI
- "22000:22000/tcp" # Sync protocol (TCP)
- "22000:22000/udp" # Sync protocol (QUIC)
- "21027:21027/udp" # Discovery
docker compose up -d
Windows and macOS
Download the installer from syncthing.net. On Windows, SyncTrayzor provides a system tray wrapper. On macOS, Syncthing for macOS (the community app) adds a menu bar icon and auto-start. Both are available from the Syncthing downloads page.
Android
Syncthing-Fork on F-Droid is the actively maintained Android client. It supports automatic sync on WiFi, battery-aware syncing, and folder selection. The original Syncthing Android app is deprecated — use the fork.
iOS
There is no official or maintained iOS app. This is Syncthing's biggest platform gap. If you need Apple mobile sync, consider Resilio Sync or Nextcloud instead.
Adding Devices
Syncthing identifies devices by a unique Device ID — a long alphanumeric string derived from a TLS certificate generated on first run. To connect two devices:
- Open the web UI on Device A (
http://127.0.0.1:8384) - Go to Actions > Show ID to see Device A's ID
- On Device B, click Add Remote Device and paste Device A's ID
- Device A will see a prompt to accept Device B — confirm it
If both devices are on the same LAN, they'll discover each other automatically and appear in the "Add Remote Device" dialog without manually copying IDs.
Once paired, devices maintain a persistent connection and reconnect automatically after network changes or reboots.
Sharing Folders
After connecting devices, you share specific folders between them:
- On Device A, click Add Folder
- Set a Folder Label (human-readable name) and Folder Path (where files live on disk)
- Under the Sharing tab, select which connected devices should have this folder
- On the receiving devices, accept the folder when prompted and choose a local path
Each device can have its own path for the same folder. You might sync ~/Documents on your laptop to /mnt/data/documents on your server.
Folder types
- Send & Receive (default) — Full two-way sync. Changes on any device propagate everywhere.
- Send Only — This device pushes changes out but ignores incoming changes. Useful for a "master copy" that other devices pull from.
- Receive Only — This device accepts incoming changes but never pushes local changes. Useful for backup endpoints.
File Versioning
When Syncthing overwrites or deletes a file during sync, you can configure it to keep old versions:
- Trash Can — Moves replaced files to a
.stversionsfolder. Cleans up after a configurable number of days. - Simple — Keeps a set number of old versions of each file in
.stversions. - Staggered — Keeps versions at increasing intervals: all versions from the last hour, one per hour for the last day, one per day for the last month, one per week for the last year.
- External — Calls an external command when a file is about to be replaced, letting you integrate with your own backup system.
Staggered versioning is the most practical choice for most setups. It gives you fine-grained recovery for recent changes and coarse-grained recovery for older ones, without eating unlimited disk space.
Conflict Resolution
When two devices modify the same file before syncing, Syncthing doesn't silently pick a winner. It keeps both versions:
- The most recent change (by timestamp) becomes the active file
- The other version is saved as
filename.sync-conflict-20260208-143022-ABCDEFG.ext
Conflict files are easy to spot and resolve manually. Syncthing avoids data loss by never discarding either version.
In practice, conflicts are rare if you're syncing personal files across your own devices. They mainly happen when two people edit the same file while both offline. For shared team folders, establish conventions about who edits what.
Relay Servers and NAT Traversal
Direct connections between devices are ideal, but not always possible. When both devices are behind NAT (common with home internet), Syncthing uses several strategies:
- Local discovery — Devices on the same LAN find each other via broadcast
- Global discovery — A lightweight server helps devices find each other's public IPs
- NAT hole-punching — Syncthing attempts to establish a direct connection through NAT
- Relay servers — If direct connection fails, data flows through community-operated relay servers (encrypted; relay operators cannot read your files)
In most cases, NAT hole-punching succeeds and you get a direct connection. When it doesn't, relays work but are slower since your data takes an indirect path. You can run your own relay server (strelaysrv) if you want to avoid using public relays.
Check the connection type in the web UI under each device's details — it shows "TCP LAN," "TCP WAN," "QUIC," or "Relay" so you know what's happening.
Ignore Patterns
Like .gitignore, Syncthing supports a .stignore file in each synced folder to exclude files from sync:
// Ignore OS junk
.DS_Store
Thumbs.db
desktop.ini
// Ignore build artifacts
node_modules
__pycache__
*.pyc
target/
dist/
build/
// Ignore large media files over a certain pattern
*.iso
*.vmdk
// Ignore temporary files
*.tmp
*.swp
~*
Place .stignore in the root of the synced folder. Changes to ignore patterns take effect on the next scan. Already-synced files that match new ignore patterns won't be deleted from other devices — they'll just stop being updated.
Security Model
Syncthing's security is straightforward:
- Encryption in transit — All connections use TLS 1.3. Devices authenticate using their TLS certificates (the Device ID is a hash of the certificate).
- No encryption at rest — Files are stored as plain files on each device. If you need at-rest encryption, use full-disk encryption (LUKS, BitLocker, FileVault) on each device.
- No accounts or passwords — There's no central authentication. Trust is established by mutually accepting Device IDs. Only devices you explicitly approve can connect.
- Open protocol — The Block Exchange Protocol is fully documented and has been independently reviewed.
The discovery and relay servers see Device IDs and IP addresses but never file contents or metadata. If this concerns you, you can disable global discovery and relay servers entirely, connecting only via static IP addresses or local discovery.
Practical Tips
Use a dedicated sync folder. Don't sync your entire home directory. Create a ~/Sync folder and organize subfolders within it. This keeps sync boundaries clear and avoids accidentally syncing gigabytes of cache files.
Set up a always-on device. The biggest limitation of peer-to-peer sync is that both devices need to be online. A Raspberry Pi, old laptop, or cheap VPS running Syncthing 24/7 acts as an always-available peer — effectively giving you the "cloud server" benefit without a cloud service.
Monitor disk space. File versioning can accumulate significant storage over time, especially with staggered versioning on large folders. Periodically check the .stversions directory size.
Use receive-only for backups. A receive-only device that syncs all your folders creates a live backup without the risk of accidental changes propagating back to your main devices.
Should You Use Syncthing?
Syncthing is ideal if:
- You want to sync files between your own devices without any third party involved
- Privacy matters to you — no company ever sees your data
- You're syncing between Linux, Android, and/or Windows/macOS desktops
- You want something that runs quietly in the background with zero ongoing cost
- You already have an always-on machine (NAS, home server, VPS) to ensure availability
Look elsewhere if:
- You need iOS support — Syncthing simply doesn't have it
- You want web-based file access — there's no browser-based file manager
- You need to share files with people who don't run Syncthing — there are no share links
- You want a single source of truth with server-side storage — that's Nextcloud's model
- You need selective sync (syncing only some files in a folder on demand)
Syncthing does one thing — continuous file synchronization between devices — and does it exceptionally well. It's not trying to be a collaboration platform, a file sharing service, or a cloud storage replacement. If what you need is reliable, private, zero-cost sync between your own machines, Syncthing has been the best answer for over a decade.