What Syncthing Does
- Direct Sync: Files sync directly between devices — no cloud server intermediary
- End-to-End Encryption: All communication encrypted with TLS 1.3
- No Account Required: No signup, no login, no cloud subscription
- Cross-Platform: Windows, macOS, Linux, Android, FreeBSD, Solaris
- Selective Sync: Choose which folders to sync on each device
- Versioning: File versioning with configurable retention (trash can, simple, staggered)
- Ignore Patterns: .stignore files for excluding files/folders (like .gitignore)
- Conflict Resolution: Automatic conflict detection with both versions preserved
- NAT Traversal: Works through firewalls with relay fallback
- Web UI: Beautiful management interface at localhost:8384
Architecture
┌──────────────┐ ┌──────────────┐
│ Device A │◄─────────▶│ Device B │
│ (Desktop) │ Direct │ (Laptop) │
│ Syncthing │ P2P │ Syncthing │
└──────┬───────┘ └──────────────┘
│
│ Direct P2P
│
┌──────┴───────┐
│ Device C │
│ (Phone) │
│ Syncthing │
└──────────────┘
No central server. All devices connect directly.
If direct connection fails → encrypted relay.Self-Hosting
Docker Compose
services:
syncthing:
image: syncthing/syncthing:latest
hostname: my-syncthing
ports:
- "8384:8384" # Web UI
- "22000:22000/tcp" # Sync protocol
- "22000:22000/udp" # QUIC sync
- "21027:21027/udp" # Discovery
volumes:
- syncthing-config:/var/syncthing/config
- /path/to/documents:/var/syncthing/Documents
- /path/to/photos:/var/syncthing/Photos
environment:
PUID: 1000
PGID: 1000
restart: unless-stopped
volumes:
syncthing-config:Key Features
Folder Configuration
Folder Types:
├── Send & Receive — Full two-way sync (default)
├── Send Only — This device is the "master" copy
└── Receive Only — This device only receives updates
Versioning:
├── Trash Can — Deleted/replaced files moved to .stversions/
├── Simple — Keep N old versions
├── Staggered — Keep versions at increasing intervals
└── External — Run custom script on file changes.stignore (Exclusion Patterns)
// .stignore file
(?d).DS_Store
(?d)Thumbs.db
(?d)desktop.ini
node_modules
.git
*.tmp
*.log
~*Multi-Device Setup
Step 1: Install Syncthing on Device A
Step 2: Install Syncthing on Device B
Step 3: On Device A, click "Add Remote Device"
Step 4: Enter Device B's ID (shown in Device B's web UI)
Step 5: Accept connection on Device B
Step 6: Share folders between devicesDevice IDs are automatically generated cryptographic identifiers — no passwords to share.
Use Cases
| Scenario | Setup |
|---|---|
| Laptop ↔ Desktop sync | Send & Receive on both |
| Phone photo backup | Send Only on phone, Receive Only on server |
| Team shared folder | Send & Receive on all team devices |
| NAS backup | Send Only from source, Receive Only on NAS |
| Dotfiles sync | Sync ~/.config across Linux machines |
Syncthing vs Alternatives
| Feature | Syncthing | Dropbox | Resilio Sync | Nextcloud |
|---|---|---|---|---|
| Open Source | Yes (MPL-2.0) | No | No | Yes |
| P2P (no server) | Yes | No | Yes | No (server) |
| Cloud storage | No | Yes (cloud) | No | Self-hosted |
| Encryption | E2E (TLS) | At rest | E2E | At rest |
| Account needed | No | Yes | Yes | Yes |
| File versioning | Yes | 30-day | Yes | Yes |
| Mobile | Android | iOS+Android | iOS+Android | iOS+Android |
| iOS app | Community (Möbius) | Official | Official | Official |
常见问题
Q: 没有中心服务器,设备怎么找到彼此? A: Syncthing 使用全局发现服务器(仅用于交换 IP 地址,不传输文件)和本地网络发现(mDNS)。设备找到彼此后直接建立 P2P 连接。如果直连失败,会通过加密中继服务器转发。
Q: iOS 支持吗? A: 官方没有 iOS 应用(Apple 对后台同步限制严格)。社区项目 Möbius Sync 提供 iOS 客户端。如果 iOS 同步是刚需,考虑 Nextcloud 或 Resilio。
Q: 能同步多大的文件/多少文件? A: 没有限制。用户报告成功同步数百 GB 甚至 TB 级数据。数百万文件的同步也可以正常工作,但初始扫描可能需要较长时间。
来源与致谢
- GitHub: syncthing/syncthing — 81.6K+ ⭐ | MPL-2.0
- 官网: syncthing.net