Complete Cross-Platform Guide to Installing and Configuring Syncthing for Decentralized File Sync
Key Capabilities of Syncthing
Syncthing is a decentralized, peer-to-peer (P2P) file synchronization tool designed to keep files in sync across multiple devices without relying on third-party servers. Its core capabilities include:
- Fully Open Source: Hosted on GitHub, Syncthing’s transparent codebase allows community audits and contributions, ensuring trust in its security.
- Decentralized P2P Architecture: Data transfers occur directly between devices, eliminating central server bottlenecks and third-party data access risks.
- Cross-Platform Compatibility: Supports Windows, macOS, Linux, BSD, Solaris, and Android, enabling sync across virtually any device ecosystem.
- Enterprise-Grade Security: All data in transit uses TLS encryption, and each device authenticates via a unique, immutable device ID to block unauthorized access.
- Real-Time Sync: Detects file modifications instantly and triggers sync operations within seconds, ensuring all devices have the latest version.
- Version History Retention: Automatically preserves previous file versions, allowing recovery from accidental edits or deletions.
- Flexible Configuration: Customize sync folders, bandwidth limits, sync schedules, and access permissions via an intuitive web interface.
Installation Guides
Windows Installation
- Download the latest Windows build from the official Syncthing website.
- Extract the ZIP archive to a permanent directory (e.g.,
C:\Tools\Syncthing). - Double-click
syncthing.exeto launch the application. A console window will open, and your default browser should automatically navigate tohttp://127.0.0.1:8384(the web management UI). - If the browser doesn’t auto-launch, manually enter the URL from the console. You’ll be prompted to opt in/out of anonymous usage data reporting—select your preferrence to proceed.
- Successful load of the web UI confirms installation completion.
Ubuntu Installation
- Upload the Linux AMD64 build to your Ubuntu server using SCP:
scp syncthing-linux-amd64-v*.tar.gz ubuntu@your-server-ip:/home/ubuntu/ - SSH into your server and extract the archive:
tar -zxf syncthing-linux-amd64-v*.tar.gz - Optional: Rename the extracted folder for easier access:
mv syncthing-linux-amd64-v* syncthing - Navigate to the folder and start Syncthing:
cd syncthing ./syncthing serve - Enable Remote Web UI Access:
- Stop the running service with
Ctrl+C. - Restart with the GUI bound to all network interfaces:
./syncthing serve --gui-address=0.0.0.0:8384 - Allow incoming traffic on port 8384 via UFW:
sudo ufw allow 8384/tcp sudo ufw reload - Access the UI remotely at
http://your-server-ip:8384.
- Stop the running service with
Configuring Bidirectional File Sync
-
Retrieve Device IDs:
- On each device, open the Syncthing web UI, click the top-right Actions menu, and select "Show ID" to copy the unique device identifier.
-
Link Devices:
- On you're Windows machine, go to the "Devices" tab, click "Add Remote Device", paste the Ubuntu server’s ID, enter a friendly name (e.g., "Ubuntu Server"), and save.
- Repeat this step on the Ubuntu server, adding the Windows device’s ID.
-
Set Up Shared Folders:
- On Windows, navigate to the "Folders" tab, click "Add Folder".
- Enter a label (e.g., "Work Documents"), set the local path (e.g.,
C:\Work\SyncedDocs), and check the Ubuntu server under "Share With". - Enable versioning in the "Versioning" tab to retain old file versions, then save.
-
Accept Sync on Ubuntu:
- On the Ubuntu web UI, a notification will appear for the shared folder. Click "Accept".
- Set the local path (e.g.,
/home/ubuntu/SyncedDocs), verify folder permissions allow read/write access, and enable sync to start bidirectional file transfers.
Setting Up Auto-Start
Windows Auto-Start
- Create a batch file (e.g.,
SyncthingAutoStart.bat) in your Syncthing directory with the following content:@echo off REM Launch Syncthing in hidden background mode if "%1"=="hidden" goto start_sync start /min mshta vbscript:CreateObject("WScript.Shell").Run("""%~dpn0""" hidden", 0)(window.close) & exit /b :start_sync cd /d "C:\Tools\Syncthing" REM Replace with your Syncthing path start "" /b syncthing.exe serve --no-browser --no-restart --logflags=0 - Right-click the batch file and select "Create Shortcut".
- Press
Win + R, typeshell:startup, and press Enter to open the Startup folder. - Move the shortcut to this folder—Syncthing will now launch automatically on login.
Ubuntu Auto-Start (Systemd Service)
- Create a systemd service file:
sudo nano /etc/systemd/system/syncthing@.service - Paste the following configurasion (replace
/home/ubuntu/syncthingwith your actual path):[Unit] Description=Continuous File Synchronization Service for User %I Documentation=https://syncthing.net/docs/ After=network-online.target Wants=network-online.target [Service] User=%i WorkingDirectory=/home/%i/.config/syncthing ExecStart=/home/%i/syncthing/syncthing serve --no-browser --no-restart --logflags=0 --gui-address=0.0.0.0:8384 Restart=on-failure RestartSec=5 SuccessExitStatus=3 4 RestartForceExitStatus=3 4 # Security Hardening ProtectSystem=strict PrivateTmp=true ProtectHome=true NoNewPrivileges=true MemoryDenyWriteExecute=true SystemCallFilter=@system-service [Install] WantedBy=multi-user.target - Save and exit (
Ctrl+O, Enter,Ctrl+X), then reload systemd:sudo systemctl daemon-reload - Enable and start the service (replace
ubuntuwith your username):sudo systemctl enable syncthing@ubuntu.service sudo systemctl start syncthing@ubuntu.service - Manage the service with these commands:
sudo systemctl restart syncthing@ubuntu.service # Restart the service sudo systemctl stop syncthing@ubuntu.service # Stop the service sudo systemctl status syncthing@ubuntu.service # Check service status