How to Self-Host Syncthing: Peer-to-Peer File Sync 2026
TL;DR
Syncthing (MPL 2.0, ~63K GitHub stars, Go) is a peer-to-peer file synchronization tool — files sync directly between your devices with no central server required. It's like Dropbox but without the cloud: each device keeps a full copy, changes sync in both directions, and everything is encrypted in transit. Use it to sync your documents between laptop and desktop, backup your phone photos to a home server, or keep config files in sync across servers. Dropbox charges $9.99/month for 2TB; Syncthing is free.
Key Takeaways
- Syncthing: MPL 2.0, ~63K stars — P2P file sync, no cloud, end-to-end encrypted
- No central server: Devices sync directly — no cloud storage needed
- Full copies everywhere: Every device has a complete copy of the shared folder
- Conflict resolution: Handles simultaneous edits with conflict files
- iOS/Android: Official apps for mobile devices
- Relay network: Falls back to relay servers when direct connection isn't possible
Syncthing vs Dropbox vs Nextcloud
| Feature | Syncthing | Dropbox Free | Nextcloud |
|---|---|---|---|
| License | MPL 2.0 | Proprietary | AGPL 3.0 |
| Cost | Free | Free (2GB) / $9.99/mo | Free (hosting) |
| Architecture | P2P (no server) | Centralized cloud | Centralized (self-hosted) |
| Storage limit | Disk size | 2GB / 2TB | Disk size |
| Mobile backup | Yes | Yes | Yes |
| File versioning | Yes (configurable) | Yes | Yes |
| Web UI | Yes (local) | Yes | Yes |
| Selective sync | Yes | Yes | Yes |
| End-to-end encryption | Yes | No | Optional |
| Share with others | Between devices | Yes | Yes |
Part 1: Docker Setup (Server/Always-On Node)
Run Syncthing on a server as an always-on sync hub:
# docker-compose.yml
services:
syncthing:
image: syncthing/syncthing:latest
container_name: syncthing
restart: unless-stopped
hostname: my-syncthing
ports:
- "8384:8384" # Web UI
- "22000:22000" # Protocol communication (TCP + UDP)
- "21027:21027/udp" # Local discovery
volumes:
- syncthing_config:/var/syncthing
- /path/to/sync:/data # Synced folder
environment:
PUID: 1000
PGID: 1000
TZ: America/Los_Angeles
volumes:
syncthing_config:
docker compose up -d
Visit http://your-server:8384.
Part 2: HTTPS with Caddy
sync.yourdomain.com {
basicauth {
admin $2a$14$hash_here # caddy hash-password
}
reverse_proxy localhost:8384
}
Or set a username/password directly in the Syncthing web UI: Actions → Settings → GUI.
Part 3: Desktop Installation
macOS / Windows / Linux
- Download from syncthing.net/downloads
- Run — a tray icon appears
- Web UI opens at
http://localhost:8384
macOS with Homebrew:
brew install syncthing
brew services start syncthing
Linux:
# Add repo and install:
sudo apt install syncthing
# Start as user service:
systemctl --user enable syncthing
systemctl --user start syncthing
Part 4: Pair Devices
Syncthing uses Device IDs (like MFZWI3D-BOZGW26-YMWUJ3I-...) for pairing.
On Device A (your server):
- Web UI → Actions → Show ID
- Copy the Device ID
On Device B (your laptop):
- Web UI → Add Remote Device
- Paste Device A's ID
- Set a name:
My Server
Repeat in reverse — both devices must add each other.
Part 5: Sharing Folders
After devices are paired:
On Device A:
- Add Folder
- Folder path:
/data/documents - Folder label:
Documents - Sharing tab → enable sharing with Device B
- Save
On Device B:
- A notification appears: "Device A wants to share folder 'Documents'"
- Accept → choose local path (e.g.,
~/Documents/Synced/) - Sync begins immediately
Part 6: Folder Types
| Type | Behavior |
|---|---|
| Send & Receive | Full bidirectional sync (default) |
| Send Only | Changes go out but don't come in — good for archive/backup source |
| Receive Only | Only receives changes — good for backup destination |
Use Receive Only on your server to create a one-way backup:
- Laptop:
Send & Receive - Server:
Receive Only
Now the server mirrors the laptop but can't send changes back.
Part 7: Mobile Apps
Android
- Install Syncthing-Fork from F-Droid (recommended) or Syncthing from Play Store
- Open → Device ID → copy
- Add on your server's web UI → paste ID
- Create/accept a shared folder
Auto-sync phone photos:
- Add Folder:
/storage/emulated/0/DCIM/Camera - Share with your server
- Server receives all new photos automatically
iOS
- Install Möbius Sync (iOS Syncthing client, ~$3)
- Or use Syncthing for iOS via TestFlight
Part 8: Versioning (File History)
Keep old versions of changed/deleted files:
- Edit Folder → File Versioning
- Versioning types:
- None: No versioning (default)
- Trash Can: Deleted files move to
.stversions/— like a local trash - Simple: Keep N versions per file
- Staggered: More versions for recent changes, fewer for old ones
- External: Run a script when a file is versioned
Staggered example:
Files changed today: keep all versions
Files changed this week: keep 1/day
Files changed this month: keep 1/week
Files older: keep 1/month
Part 9: Ignore Patterns
Don't sync certain files:
# .stignore (place in the folder being synced)
# Syntax similar to .gitignore
*.tmp
*.log
.DS_Store
Thumbs.db
node_modules/
.git/
The .stignore file itself syncs across devices so all devices use the same rules.
Part 10: Relay Servers
When devices can't connect directly (NAT/firewall), Syncthing uses relay servers as a fallback. The data is still encrypted end-to-end — relays only forward encrypted traffic.
To configure your own relay (for privacy or performance):
# Relay server (separate container):
services:
syncthing-relay:
image: syncthing/relaysrv:latest
restart: unless-stopped
ports:
- "22067:22067"
- "22070:22070"
In Syncthing settings, add your relay URL.
Maintenance
# Update Syncthing:
docker compose pull
docker compose up -d
# Logs:
docker compose logs -f syncthing
# Check sync status via API:
curl http://localhost:8384/rest/db/status?folder=FOLDER_ID \
-H "X-API-Key: $(cat ~/.config/syncthing/config.xml | grep -o 'apikey>[^<]*' | cut -d'>' -f2)"
# Backup config:
tar -czf syncthing-config-$(date +%Y%m%d).tar.gz \
$(docker volume inspect syncthing_syncthing_config --format '{{.Mountpoint}}')
See all open source file sync and backup tools at OSSAlt.com/categories/storage.