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
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.
-
New KDE Slimbook Plasma Available for Preorder
Powered by an AMD Ryzen CPU, the latest KDE Slimbook laptop is powerful enough for local AI tasks.