Syncthing

← Back to blog

Other file sync solutions

I’ve been using file storage and synchronisation services for almost 10 years. What started as a simple way of backing up my personal files has become a critical part of my work flow as I often have to jump between different devices. Over that time, I’ve tried the likes of Dropbox, Google Drive, and most recently, MEGAsync, but I haven’t been completely satisfied with them.

In summary, what I really want is a file sync service that is

  1. Free
  2. Able to handle 10-20 GB of files
  3. Cross-platform
  4. Reliable, in that I don’t have to spend time working out why my files are out of sync

Why Syncthing?

I stumbled across Computers as I used to love them and Syncthing seemed like the natural next step for me. I love that its free and open-source, and that it doesn’t rely on some central server storing all of your files. It removes the artificial limitation of having to pay for storage space – now I can sync as much as can fit on my hard-drive. Additionally, you can sync any folder on your hard-drive, it doesn’t have to be contained within some central sync folder.

The only downside is that there is no iOS app yet, but I don’t really browse my files from my phone. A more common use case for me is transferring files and I’m still on the lookout for an appropriate tool.

Installing on MacBook

Setting up Syncthing was super simple. To get set up, all you need to do is download a binary from the project releases page and run it. In my case, I just used Homebrew:

brew install syncthing
brew services start syncthing

By default, Syncthing runs on localhost:8384. To avoid Syncthing opening the browser UI when it starts, you need to uncheck Start Browser under Actions > Settings > GUI.

Installing on Windows (WSL)

To install Syncthing on Ubuntu (the OS I’m using for WSL), it’s as simple as

# Add the release PGP keys:
sudo curl -s -o /usr/share/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg#+end_src
# Add the "stable" channel to your APT sources:
echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
# Update and install syncthing:
sudo apt-get update
sudo apt-get install syncthing

The version of Syncthing available by default with Ubuntu is old and doesn’t run properly so it’s important to add either the “candidate” or “stable” channel.

Getting Syncthing to automatically startup is not as easy as it is on MacOS. It turns out that systemd is not fully operational on WSLAs of Nov 2021, Canonical is working on bringing systemd to WSL.. Instead, my approach was to add the following snippet to my .zprofile:

# Start Syncthing
if ! /usr/bin/pgrep syncthing > /dev/null; then
    (nohup syncthing > /dev/null 2>&1 &)
fi

Sharing a folder between devices

I’ve added my MacBook Air to my Windows desktop machine. Then sharing a folder was as easy as clicking edit and selecting the device to share with.

So far, I’ve only shared my org files, but they’re by far the files I edit the most.

Things to look out for

Coming from other file sharing solutions, something I didn’t expect was that there is no ’passive’ syncing. As a consequence of peer-to-peer file syncing, if you want your changes on one device to be replicated on another device, they need to communicate with each other, i.e., be online at the same time.