Syncthing

Updated 19-Aug-2025

Note: v.2.x.x has been released:

Syncthing is a continuous file synchronization program. It synchronizes files between two or more computers in real time, safely protected from prying eyes. Your data is your data alone and you deserve to choose where it is stored, whether it is shared with some third party, and how it’s transmitted over the internet.

  • See also the local file sync tool FreeFileSync for handy local drive copying.

Google Drive (GDrive) and other cloud storage alternatives such as Dropbox and Microsoft OneDrive all have the serious drawback of keeping one's information in a third party cloud repository. Privacy and security are generally compromised this way, even when paying for storage (as opposed to having an advertising model, which is worse in many ways).

The challenge is to have an equally robust service that can effectively, and efficiently (regarding resource requirements) sychronize files across multiple devices. Remain on our own devices. And remain open source. While Syncthing is available on MacOS and Windows, we are concerned primarily with:

  • Android
  • Debian Linux

Options such as OwnCloud don't work because of the high overhead needed to get the services to run, in terms of memory and processing on a server, though they might be more useful in multi-user environments.

  • See also CopyParty, which is quite awesome.

Syncthing for File Synchronization

File synchronization is not backup, though with versioning there is a sort of backup-lite going on. Syncthing versioning doesn't really work as expected by the name, so that is really backup-very-lite.

Install Syncthing on Debian stable

Syncthing source and key

  • Create or edit source file:

/etc/apt/sources.list.d/syncthing.sources

Types: deb
URIs: https://apt.syncthing.net/
Suites: syncthing
Components: stable
Signed-By: /etc/apt/keyrings/syncthing-archive-keyring.gpg
  • Install Syncthing *.gpg
sudo mkdir -p /etc/apt/keyrings
sudo curl -L -o /etc/apt/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg

Syncthing user and access rights

Create the syncthing user, grant sudo access, and su into the account:

sudo adduser syncthing
sudo usermod -aG sudo syncthing
su - syncthing

Install syncthing

This can be done via apt or directly with a download from the github releases:

wget https://github.com/syncthing/syncthing/releases/download/v2.0.1/syncthing_2.0.1_amd64.deb
sudo apt install ./syncthing*

or

sudo apt update
sudo apt install syncthing

Enable and start the service

sudo systemctl enable syncthing@syncthing.service
sudo systemctl start syncthing@syncthing.service

Enable syncthing on ufw

Enable ufw ports for syncthing

sudo ufw allow syncthing
sudo ufw allow syncthing-gui
sudo ufw reload

Access to GUI console from any IP

Enable the gui to be accessed from any IP address, if desired:

sed -i 's/127.0.0.1/0.0.0.0/' ~/.local/state/syncthing/config.xml

Another option for more security is to change the IP address to one's own IP address (after making changes with the sed command above, once that IP address is enabled). Or, only allowing from 127.0.0.1 using a VPN into the server.

GUI console password

Create a username and password for the GUI console found at http://serveripaddress:8384

  • > Actions > Settings > GUI
    • GUI Authentication User
    • GUI Authentication Password

Forgot username and password?

  • How do I reset the GUI Password? note that you need to do this from the account that runs the syncthing service. The username, hashed password, and API key will be written to the /.config/syncthing/config.xml file.

Syncthing CLI

A very useful CLI:

syncthing cli config options
  • Will let you see what config options there are at the CLI.

Install Syncthing on Android

Note May 2025 The original Syncthing is no longer on the Play Store (or elsewhere) so now we use Syncthing-Fork available on F-Droid and Github. Note: even better is to use Obtanium. (Does no one think about the problems with Github and Open Source?)

If there is problem installing or updating from an F-Droid client, then simply sideload the Github .apk file. Note that F-Droid and Github have the same signatures but the Google Play Store is submitted by a different developer and the signatures don't match. Stick with one or the other (or uninstall / reinstall will become necessary).

However, if one still has trouble installing as the system claims it already has an installation, then one needs to use adb after connecting the Android device to a computer, and removing the app with:

adb shell pm uninstall com.github.catfriend1.syncthingandroid

Note, if unsure of the name of the package to uninstall, try:

adb shell cmd package list packages -u

Best practices with Android

Note that the best approach is to share out something like /syncthing-photos as a one-way share, and root that to the photos directory (either the local device or MicroSD card), and then also create an inbound two-way sync for a subset of critical documents.

For devices with more storage, additional inbound two-way shares could be added to provide greater access to one's documents.

For example on an Android device with a MicroSD card, the photos are shared under /storage/CE6A-1402/DCIM/Camera. Note that the best approach is then a manual copy/paste of the images to a better archived directory structure that is then synced to a backup server, and a manual image deletion on the Android device, on a monthly basis.

For an inbound, two-way sync to the Android device for critical (editable) files, the directory is: /storage/emulated/0/Download. Note that this is the same directory that is used in ChromeOS for inbound, two-way shares.

Some Issues with Synchronizing

The main thing is to think out one's synchronization policies and plans. One-way synchronization, two-way sinchronization, master and slave device replication, etc. There are many options. Some files one will want to keep everywhere, with version control. Other files one will want only in one or two locations (large files/repositories).

The best approach is to partition into folders so that different folders contain different content that will be sychronized differently. Some examples:

  • Images/Photos folder on a mobile device
    • Should be synchronized but also allow for repository of more images on a backup location.
    • Workflow: sync mobile folder to desktop. On desktop, move images to a second folder (removing them from mobile via synchronization), and then have the second folder synchronized to a server. That server folder can have SFTP for remote access and also provide two-way synchronization back to the desktop for things such as editing images that are on a web server.

It is important to have a manual workflow as well (or semi-automated) so that things are easier to manage.

Synchronization vs. SFTP

Synchronization is useful, but is not a replacement for SFTP which should be seen as on-demand push/pull. For example, a large repository can be synchronized between two larger-capacity devices (e.g, Debian server and Debian workstation), but also allow access via SFTP for smaller-capacity devices (ChromeOS/Android).

Syncthing troubleshooting

  • If says can't find folder, then create a .stfolder folder in the root of the specific shared directory
  • If get an inode error (especially on Android) turn off Watch for Changes in > WEB GUI > SHARE > Advanced

Syncthing Version Control (very-lite)

There are many different version control options for Syncthing, depending on what versioning scheme and how much storage will be set aside for it. Basically, however, this version of version control/backup is total crap since it only makes a backup on synching to another machine (e.g., if the source is overwritten by a downstream sync, then the source keeps a copy of the original before overwriting. This means if working on a single original source there is no version control/backup.

Basically, the most reasonable option for version control, in this situation of a severe lack, is probably an automated git versioning.

Value of Syncthing for the Enduser

Ultimately, Syncthing lets the enduser take full control over their data on their devices in terms of files that are synchronized with other devices. Along with SFTP on a server, and possibly something like AWS S3 and Glacier, it appears to provide a useful protocol, gui admin console, and applications that can do everything that GDrive/Dropbox/OneDrive offer in terms of synchronization. Since disk space is already something that can be managed at the level of S3/Glacier and local devices, it provide a key element in a resource-efficient, open source package.

Real World Replacement of Dropbox

I've got syncthing running on four devices with the main desktop (Debian testing) as the primary repository. Nearly all of the reposed data is syncronized to a Debian stable server running on AWS lightsail. This is a web server with 80gb of storage ($20/month), and my data consists of approximately 90,000 files, 10,000 directories, and 40gb of storage. The third device is my Android phone which syncs out photos, and inbound syncs a lightweight directory of editable files, which allow for reading/editing those files on-the-go. The fourth device is a Chromebook convertible which has the least storage of all devices, but nevertheless is able to handily inbound sync about 5gb of data and allows for most of the working directories on active projects.

We use cookies only for WordPress functionality, and do not use third-party analytics or tracking.
Accept