What is Syncthing
Syncthing is an open-source, continuous file-synchronization tool. It replicates files across multiple devices in real time using a decentralized, peer-to-peer (P2P) architecture.
Use this lesson to understand Syncthing's fundamental mental model: it relies on mutual trust between devices and synchronizes states continuously, rather than behaving like a top-down server-client tool.
There is no central server. Every device is an equal node that holds a complete, independent copy of the shared folder data.
Concept Overview
Syncthing replaces cloud services like Dropbox or Google Drive for data synchronization, but it operates entirely without a middleman.
- A Node (or Device) is any computer running Syncthing (laptop, VPS, NAS, phone).
- A Folder Pair is a directory shared between two or more nodes.
- Continuous Sync means Syncthing monitors the filesystem (using things like
inotify) and instantly replicates changes.
Syncthing Is Great For
| Scenario | Why Syncthing works |
|---|---|
| Multi-device continuous sync | Real-time replication across laptops, workstations, and phones |
| Decentralized replication | No dependency on third-party cloud capacity or downtime |
| Encrypted transfer | End-to-end TLS encryption over the wire |
| Air-gapped or offline networks | Syncs over LAN even if the internet is down |
Syncthing Is Not The Best For
| Scenario | Better tool |
|---|---|
| Point-in-time snapshot backups | restic or borg |
| One-way large scale system migrations | rsync |
| Cloud object storage retrieval | rclone |
Why Teams Use Syncthing
| Need | Syncthing capability | Practical effect |
|---|---|---|
| Data Privacy | No central cloud server | Data never leaves your hardware or control |
| Real-time Updates | Event-driven replication | Edits on a laptop reflect on the NAS within seconds |
| Bandwidth Efficiency | Block Exchange Protocol (BEP) | Only modified blocks are sent, not entire files |
Architecture at a Glance
Syncthing connects devices directly using TLS-encrypted connections.
flowchart LR
LAP["Laptop (Node A)"] <-->|TLS P2P| VPS["VPS (Node B)"]
LAP <-->|TLS P2P| DESK["Desktop (Node C)"]
VPS <-->|TLS P2P| DESK
Notice the mesh topology. If LAP goes out of network coverage, but connects locally to DESK, and DESK connects to VPS, updates will propagate.
Terminology You Must Know
| Term | Meaning | Example |
|---|---|---|
| Device ID | A unique cryptographic identifier for a node. | K3X2R... |
| Index | A database maintained by each node tracking file states. | The local database |
| Discovery | How nodes find each other on LAN/WAN. | Local discovery, Global discovery |
| Relay | A fallback server that passes encrypted traffic if nodes can't connect directly. | Public relay pool |
| Global State | The combined view of the most up-to-date files across all connected nodes. | What Syncthing aims to achieve |
| Local State | The current files actually present on the local disk. | The current disk state |
Hands-On Practice
If you have Syncthing installed, you can easily view your Device ID. Usually, it's visible right from the web GUI, but you can also run:
syncthing --device-id
Quick Reference
| Feature | Details |
|---|---|
| Protocol | Block Exchange Protocol (BEP) |
| Encryption | TLS 1.2+ for all communication |
| Topology | Decentralized Mesh |
| Default GUI Port | 127.0.0.1:8384 |