Synchronizing data between computers and mobile devices using Syncthing
In Step
Syncthing is a free alternative to BitTorrent Sync for synchronizing data on computers and mobile devices.
Users have several reasons for synchronizing data between different devices. Synchronization lets you keep directories with the same contents on a workstation and on a laptop, or you can use synchronization to back up a video or music collection.
Popular services like Dropbox, Google Drive, Box, and other providers offer an easy means to synchronize files, but many users aren't comfortable with the privacy concerns associated with public cloud services. An alternative remote synchronization tool is BitTorrent Sync [1], which is based on the BitTorrent protocol's peer-to-peer (P2P) [2] system. Of course, many Linux users want as much Free Software as possible: BitTorrent Sync does not meet this requirement – the program is distributed as freeware, but the source code is not open.
Syncthing [3] (Figure 1) has been available as a free alternative since 2014. Like BitTorrent Sync, Syncthing uses peer-to-peer technology; however, its source code is licensed under the Mozilla Public License [4].
The Syncthing team is constantly developing the software and regularly publishes updates every one or two weeks. As well as both 32- and 64-bit versions of Linux, Syncthing also supports various BSD derivatives, Solaris, Android, Windows, and Mac OS X. An app for iOS will also be released soon.
You can install Syncthing in Arch Linux via the Community repository; the program is also in the repositories of current issues of Fedora and openSUSE. Plans call for integration with Debian, Ubuntu, and their derivatives [5]. Syncthing gets along with ARM CPUs, including the Raspberry Pi, Raspberry Pi 2, and other nano-PCs; and Synology's NAS systems. Syncthing can be found in the Google Play Store [6] or in the open source F-Droid [7] store for Android.
Peer to Peer-to-Peer
Unlike other free cloud-based storage solutions such as ownCloud, Syncthing (like BitTorrent Sync) does not store the uploaded data on a central server; instead, it distributes it to the computers (or nodes if you prefer) participating in the P2P network. The Syncthing team developed the open Block Exchange Protocol [8] for the necessary data exchange. Stringent encryption algorithms ensure that only you as the user can access your data.
Syncthing synchronizes data from the local network and between remote computers. To make this as easy as possible for users outside the home network, the software – like its role model BitTorrent Sync – uses UPnP [9], which you might need to enable on your router. This function should be enabled natively on most routers, and the routers will thus automatically set up the necessary port forwarding. If your router does not offer UPnP, you need to configure port forwarding manually: forward TCP port 22000 to your computer to integrate remote computers. If the computer resides behind a local firewall, forward port 22000/TCP and also UDP port 21025.
First Launch
After installing on your choice of distribution, you can access Syncthing via the menu or in a terminal with normal user rights. The scenario used for this test consisted of a system with Debian "Sid," a laptop with Fedora 22 siduction, and an Android smartphone.
When first launched, Syncthing generates keys and certificates that guarantee a secure exchange of data on the network. The program then automatically opens the web interface in a browser – Syncthing does not natively provide a standard interface. You would have to add this later using Syncthing GTK (Figure 2), if needed. Packages are available for various distributions on GitHub [10]. However, when setting up the packages, you should ensure that the specified dependencies are installed in advance.
Configuration
The first steps assume that you are starting Syncthing on all nodes (i.e., all computers belonging to the network). The first step is to organize the web interface settings, which you can access via the cogwheel icon at the top right on the web page (Figure 3). Pay particular attention to the sub-items Settings and Show ID.
Next, enter a unique Device Name in Settings; Syncthing uses the device's hostname by default. You can also limit the data rates here if you need to be sparing with your Internet connection's bandwidth. The default 0 uses all available bandwidth. If available, Enable UPnP here and define whether Syncthing should advertise the computer globally and locally. Additionally, switch on HTTPS at this point and enter a username together with a password for the web interface.
Checking Anonymous Usage Reporting sends information to the project about user behavior for the management of development accordingly. The link behind the option conveys more detailed information. You do not need to consider the other options at first. All settings can also be viewed in ~/.config/syncthing/
and edited using a text editor.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
System76 Refreshes Meerkat Mini PC
If you're looking for a small form factor PC powered by Linux, System76 has exactly what you need in the Meerkat mini PC.
-
Gnome 48 Alpha Ready for Testing
The latest Gnome desktop alpha is now available with plenty of new features and improvements.
-
Wine 10 Includes Plenty to Excite Users
With its latest release, Wine has the usual crop of bug fixes and improvements, along with some exciting new features.
-
Linux Kernel 6.13 Offers Improvements for AMD/Apple Users
The latest Linux kernel is now available, and it includes plenty of improvements, especially for those who use AMD or Apple-based systems.
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.