Syncthing
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.
- Dropbox: Only starts you with 2 GB (up to 16 GB if you complete all the tasks and refer other people), which just isn’t enough for how I workI like storing a bunch of reference material and having it on hand across all my devices. Overall though, I enjoyed the user experience of Dropbox the most and think it’s maybe the most suitable for less technical users.
- Google Drive: Similar to Dropbox, the free plan only gives you 15 GB of space and that’s shared across all of your Google services. Additionally, I had a lot of trouble getting Google Drive to work on Linux properly – despite Google saying an official client was in the works for years, nothing ever came out. There are third party clients you can use, but I would relatively frequently run into sync issues that were a headache to debug and fix.
- MEGAsync: Finally I came across something that seemed like my long-term solution. MEGAsync offers 50 GB of storage on its free tier and is cross-platform; I was able to get it running on Windows/MacOS/Linux without too much trouble. It also has mobile apps and a web client which have been great for transferring files between my computer and my phone and The main issue I’m having with it now is that on my MacBook, it won’t automatically detect changes and I frequently have to restart the client to force a sync.
In summary, what I really want is a file sync service that is
- Free
- Able to handle 10-20 GB of files
- Cross-platform
- 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.