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
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.