Not all self-hosting requires an always-on server with a web interface. Syncthing is an open source program that syncs folders directly between devices, with no central service holding the files. The laptop, the desktop PC, the phone and perhaps a NAS exchange changes among themselves, encrypted, whenever they are connected.
The operating model
Each Syncthing installation generates a device ID, a long string derived from its certificate. To connect two devices you add each other's IDs: there are no accounts, passwords or sign-ups. Communication uses TLS, and each side verifies the other's identity through its certificate.
To find each other, devices use:
- local discovery, which finds them on the same home network;
- global discovery servers, which say at which address an ID can be reached;
- relays, used only when a direct connection is impossible, for example behind restrictive NAT. Data passes through the relay already encrypted.
If you prefer not to depend on any public infrastructure, you can disable global discovery and relays and enter device addresses by hand, or host your own discovery server and relay.
Folder types
The most important choice for each shared folder is its type:
| Type | Behaviour | Example use |
|---|---|---|
| Send & receive | changes flow in both directions | work documents between PC and laptop |
| Send only | the device publishes but ignores others' changes | the phone's camera folder |
| Receive only | the device receives but does not propagate its own changes | the copy on the NAS |
A very robust setup for phone photos is: phone as "send only", NAS as "receive only". If something on the NAS is changed by mistake, the change does not travel back to the phone; the interface then lets you revert to the original state.
File versioning
Syncthing is not a backup, but file versioning provides a safety net against deletions and overwrites coming from other devices. It is configured per folder:
- trash can: deleted or replaced files are moved to a
.stversionsfolder, optionally with a maximum age; - simple: keeps a fixed number of previous versions;
- staggered: keeps more recent versions and progressively fewer as they age;
- external: delegates to a custom command.
Versions are saved on the device that receives the change, not on the one that makes it. This is why you should enable them at least on the device acting as the archive, such as the NAS or desktop PC.
Excluding what you don't need
The .stignore file at the root of the folder lists what should not be synced. A typical example for a projects folder:
// temporary files and caches
(?d).DS_Store
(?d)Thumbs.db
*.tmp
node_modules
.cache
The (?d) prefix allows Syncthing to delete those files if they prevent a folder from being removed. Remember that .stignore is not synced: each device has its own, and if you want shared rules you can create a synced file and include it with the #include directive.
Concrete use cases
In my work Syncthing often shows up in these setups:
- Notes and documents in Markdown between laptop, PC and phone, with no application server.
- The phone's camera folder to the NAS, as a first step before the real backup.
- Personal configuration (editor settings files, scripts) across several computers.
- A remote copy to a relative's computer in another home, receive-only and with versioning enabled.
The last case is interesting: two homes running Syncthing get a geographically separate copy without subscriptions. To make it a real backup, though, you need versioning enabled and, ideally, a periodic snapshot on the destination device.
Typical problems
- Conflicting files. When the same file is modified on two devices before syncing, Syncthing keeps both versions, renaming one with
sync-conflictin its name. Look for them and resolve them periodically. - A phone that won't sync. On Android, battery saving can suspend the app: exclude it from battery optimisation. On iOS there is no official app; third-party clients exist, with limits tied to background operation.
- An empty folder that empties everything. If a disk is not mounted and the folder appears empty, Syncthing notices the missing
.stfoldermarker and pauses the folder instead of propagating the deletion. Never delete that marker.
In short
- Syncthing syncs folders directly between devices, with no accounts or central server.
- Devices authenticate with certificates; global discovery and relays can be disabled or self-hosted.
- The "send only" and "receive only" folder types prevent many mistakes.
- Versions are saved on the device receiving the changes and should be enabled on the archive.
- It is not a complete backup, but it is an excellent building block for one.