Dropbox gives you 2GB free, charges $12/month for 2TB, and scans every file you upload. Google Drive is no different — your documents train their AI models and feed their ad network. If you want file sync without the surveillance tax, Syncthing is the answer.
Syncthing is a free, open-source, peer-to-peer file synchronization tool. It syncs files directly between your devices with no cloud server in the middle. No accounts, no storage limits, no monthly fees. Your files never touch a third-party server.
What is Syncthing?
Syncthing replaces Dropbox, Google Drive, and OneDrive by synchronizing files directly between devices using a peer-to-peer protocol. Every connection is encrypted with TLS, and devices authenticate using certificate-based identity — no passwords to leak.
Why Self-Host Syncthing?
- No cloud dependency: Files sync directly between your devices
- No storage limits: Use as much disk space as you have
- End-to-end encrypted: TLS 1.3 for all connections
- No accounts: No email, no password, no sign-up
- Cross-platform: Linux, Windows, macOS, Android (iOS via Möbius Sync)
- Selective sync: Choose which folders sync to which devices
- Version history: Built-in file versioning to recover deleted or changed files
- Lightweight: Uses minimal CPU and memory
Prerequisites
Before starting, you’ll need:
- A Linux server (Ubuntu 22.04+ or Debian 12+ recommended)
- Docker and Docker Compose installed
- At least 512MB RAM (Syncthing itself uses very little)
- Disk space for the files you plan to sync
- Port 22000 (TCP/UDP) accessible between devices for sync traffic
- Port 21027 (UDP) for local discovery (optional, LAN only)
Step 1: Create the Project Directory
mkdir -p ~/syncthing
cd ~/syncthing
Create a docker-compose.yml file:
nano docker-compose.yml
Step 2: Configure Docker Compose
Paste the following configuration:
version: "3"
services:
syncthing:
image: syncthing/syncthing:latest
container_name: syncthing
hostname: my-syncthing
environment:
- PUID=1000
- PGID=1000
volumes:
- ./config:/var/syncthing/config
- ./data:/var/syncthing/data
ports:
- "8384:8384" # Web UI
- "22000:22000/tcp" # Sync protocol (TCP)
- "22000:22000/udp" # Sync protocol (QUIC)
- "21027:21027/udp" # Local discovery
restart: unless-stopped
Understanding the Ports
- 8384: Web interface for managing Syncthing
- 22000 (TCP/UDP): The actual sync traffic between devices
- 21027 (UDP): Local discovery so devices on your LAN find each other automatically
Step 3: Start Syncthing
docker compose up -d
Check that it’s running:
docker compose logs -f syncthing
You should see Syncthing generating its device ID and starting the web interface. Press Ctrl+C to exit the logs.
Step 4: Access the Web UI
Open your browser and navigate to:
On first launch, Syncthing will prompt you to set a GUI password. Do this immediately — the web UI has full control over your sync configuration.
- Click Settings (top right)
- Go to the GUI tab
- Set a username and strong password
- Click Save
Step 5: Secure the Web UI
If you’re accessing Syncthing over the internet, put it behind a reverse proxy with HTTPS. Never expose port 8384 directly to the internet without encryption.
With Nginx Proxy Manager, create a new proxy host:
- Domain:
sync.yourdomain.com - Forward Hostname:
your-server-ip - Forward Port:
8384 - SSL: Request a new certificate with Let’s Encrypt
- Force SSL: Enabled
Then restrict Syncthing to listen only on localhost:
ports:
- "127.0.0.1:8384:8384"
- "22000:22000/tcp"
- "22000:22000/udp"
- "21027:21027/udp"
Restart with docker compose up -d after changing the port binding.
Step 6: Connect a Second Device
Syncthing works by connecting devices using unique Device IDs. To add a second device:
On Your Server
- Open the web UI
- Click Actions → Show ID to see your server’s Device ID (a long alphanumeric string)
On Your Second Device
Install Syncthing:
- Linux:
apt install syncthingor use the Docker setup above - Windows/macOS: Download from syncthing.net
- Android: Install from F-Droid or Google Play
Then:
- Open Syncthing on the second device
- Go to Add Remote Device
- Paste the server’s Device ID
- Give it a name (e.g., “Home Server”)
- Click Save
Accept the Connection
Back on your server’s web UI, you’ll see a notification: “New Device”. Click Add Device, confirm the name, and click Save.
The two devices are now paired.
Step 7: Share a Folder
With devices connected, create a shared folder:
On the Server
- Click Add Folder in the web UI
- Set the Folder Label (e.g., “Documents”)
- Set the Folder Path to
/var/syncthing/data/documents(inside the container) - Go to the Sharing tab
- Check the box next to your second device
- Click Save
On the Second Device
You’ll receive a notification to accept the shared folder. Click Add, choose a local path for the files, and click Save.
Files will start syncing immediately.
Step 8: Configure File Versioning
Syncthing can keep old versions of files so you can recover from accidental edits or deletions:
- Click on a folder → Edit
- Go to the File Versioning tab
- Choose a versioning strategy:
| Strategy | Best For |
|---|---|
| Trash Can | Simple recovery — deleted files go to .stversions |
| Simple | Keep the last N versions of each file |
| Staggered | Keep versions at increasing intervals (hourly → daily → weekly) |
| External | Run a custom script on version events |
Recommended: Use Staggered versioning for most folders. It keeps hourly versions for 24 hours, daily versions for 30 days, and weekly versions for a year.
Step 9: Ignore Patterns
Prevent specific files from syncing by creating a .stignore file in the folder root:
Edit ignore patterns through the web UI: click a folder → Edit → Ignore Patterns.
Step 10: Optimize for Performance
Increase Inotify Watchers (Linux)
Syncthing watches for file changes in real time. If you’re syncing many files, increase the inotify limit:
echo "fs.inotify.max_user_watches=204800" | sudo tee -a /etc/sysctl.d/90-syncthing.conf
sudo sysctl -p /etc/sysctl.d/90-syncthing.conf
Limit Bandwidth
If Syncthing saturates your connection, set rate limits:
- Settings → Connections
- Set Download Rate Limit and Upload Rate Limit (in KiB/s)
- Click Save
Disable Global Discovery (LAN Only)
If your devices are always on the same network, disable global discovery for faster connections and more privacy:
- Settings → Connections
- Uncheck Global Discovery
- Uncheck Enable Relaying
- Click Save
Troubleshooting
Devices Not Connecting
Check firewalls: Port 22000 (TCP and UDP) must be open on both devices. On Ubuntu:
sudo ufw allow 22000/tcp
sudo ufw allow 22000/udp
sudo ufw allow 21027/udp
Check the Device ID: Make sure you copied it correctly — one wrong character and it won’t connect.
Check relay status: If direct connections fail, Syncthing falls back to relay servers. You’ll see “Relay” in the connection type. This is slower but works through NATs and firewalls.
Sync Conflicts
When the same file is modified on two devices simultaneously, Syncthing creates a conflict file:
Resolve conflicts manually by comparing the files and keeping the version you want.
High CPU Usage
Large initial syncs can spike CPU. This is normal and settles down. If it persists:
- Check if the folder has too many small files (consider ignoring
node_modules,.git, etc.) - Increase the Rescan Interval in folder settings (default is 3600 seconds)
- Ensure inotify is working so Syncthing doesn’t fall back to polling
Web UI Not Loading
If port 8384 isn’t responding:
docker compose logs syncthing | grep -i "gui"
Check if the container is healthy:
docker compose ps
Advanced: Send-Only and Receive-Only Folders
Syncthing supports one-way sync:
- Send Only: This device pushes changes but ignores changes from other devices. Great for a “master copy” server.
- Receive Only: This device pulls changes but never pushes local modifications. Perfect for backup destinations.
Set the folder type in Edit Folder → Advanced → Folder Type.
Advanced: Untrusted (Encrypted) Devices
Syncthing supports encrypting data on remote devices. The remote stores your files but can’t read them — useful for syncing through a VPS you don’t fully trust:
- When sharing a folder with a device, set a Password in the Encryption section
- The remote device stores encrypted blobs
- Only devices with the password can decrypt the files
This turns any cheap VPS into a private encrypted relay.
Syncthing vs Cloud Storage
| Feature | Syncthing | Dropbox | Google Drive |
|---|---|---|---|
| Cost | Free forever | $12/month (2TB) | $3/month (100GB) |
| Storage limit | Your disk size | Plan-based | Plan-based |
| Privacy | Files never leave your devices | Scanned for content | Trains AI models |
| Speed (LAN) | Gigabit+ | Limited by upload/download | Limited by upload/download |
| Offline access | Full — it’s local files | Selective sync | Selective sync |
| File versioning | Built-in, configurable | 30-day history | 30-day history |
| Encryption | TLS + optional at-rest | At-rest only | At-rest only |
Wrapping Up
Syncthing gives you everything Dropbox does — minus the monthly bill, the storage cap, and the company reading your files. Setup takes 10 minutes, it runs on practically anything, and once configured, it just works in the background.
For most self-hosters, the ideal setup is a central server that syncs with all your devices, combined with staggered versioning for safety. Add encrypted remote devices if you want off-site redundancy without trusting a third party.
Your files. Your devices. No middleman.