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
-
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.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.
-
Fedora 41 Released with New Features
If you're a Fedora fan or just looking for a Linux distribution to help you migrate from Windows, Fedora 41 might be just the ticket.
-
AlmaLinux OS Kitten 10 Gives Power Users a Sneak Preview
If you're looking to kick the tires of AlmaLinux's upstream version, the developers have a purrfect solution.
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.
-
VirtualBox 7.1.4 Includes Initial Support for Linux kernel 6.12
The latest version of VirtualBox has arrived and it not only adds initial support for kernel 6.12 but another feature that will make using the virtual machine tool much easier.