
Note: v.2.x.x has been released:
- Syncthing (deb)
- Syncthing forum
- BasicSync (android wrapper/app)
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 (unrelated) 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 also 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. There are some internal backup options such as trash can and deleted/modified folders, if desired.
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 ports 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
sedcommand above, once that IP address is enabled). Or, only allowing from127.0.0.1using 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.xmlfile. - To reset the username and password, use the following commands:
syncthing cli operations shutdown
syncthing generate --gui-password=NEWPASS --gui-user=NEWUSER
sudo systemctl start syncthing@syncthing.service
Install Syncthing on Android
Note 20 April 2026: Before, I had instructions such as installing syncthing-fork (syncthing-android) as a play store app or via Obtainium or using adb but those forks are now too great of a risk with unknown folks having access to signing keys, and frankly dismissive interactions, and locking of issues. These are not serious people, and they have inadvertantly been given power over distributions with thousands of users.
Thankfully there is a silver lining, as BasicSync has been created under these conditions.
Best practices with Android
- Note that the best approach is to share out
/DCIM/Camerato remotes, and then also create an inbound two-way sync for critical documents. - For devices with more storage, additional inbound two-way shares could be added to provide greater access to one's documents.
Syncing to MicroSD cards
- For MicroSD cards, use the android app Material Files to copy the directory of the sdcard
Note, use the Material Files app to copy the actual path (the hyphenated 8 character string) of any given phone's SD card.
Files drop down > SD card > three dots menu > Copy path
The result will look something like: /storage/6233-3535
We create shares under that for each of the shares in Syncthing.
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
.stfolderfolder in the root of the specific shared directory - If get an inode error (especially on Android) turn off
Watch for Changesin > 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.
Using external drives for syncing
- I've had some trouble, so look here if still desiring such.