BitTorrent Sync Tutorial | Private Cloud SyncCategory: cloud
A 6 Minute Read
18 Jan 2014
Support The Tin Hat on Patreon! Just one dollar makes all the difference in helping me write more content!
Note: I no longer recommend BitTorrent Sync. The project changed directions as it left beta. I would now strongly recommend Syncthing as an excellent open-source alternative.
Ever since the Summer of Snowden many have begun to question the safety of cloud storage, particularly because we now know that services such as Dropbox aren't trustworthy. Nevertheless, the majority of us continue to store data on the cloud for the mere convenience it offers. But what if you could sync all of your devices without ever touching 'the cloud'? BitTorrent Sync does just that.
BitTorrent Sync synchronizes whatever folders you choose to any number of devices. While it isn't open source, not having personal data stored on servers that you don't own makes BitTorrent Sync much more trustworthy than its counterparts, and in this tutorial we'll learn how to use it.
What It Is
Unsurprisingly, BitTorrent Sync (BTSync) works similarly to BitTorrent: it's basically your own personal torrenting network. What this means is that if you have three devices synced and you add a file to one of them, BTSync will send the changes to the other two. Accordingly, if you were to add an additional device, the three other devices would all upload the file to the new device.
If you're reading between the lines you'll notice that the more devices that you have on your BitTorrent Sync network, the faster any downloads will be. To sweeten the deal, BitTorrent Sync uses AES encryption as the files are in transit, preventing eavesdroppers from reading your data in transit.
Notice also that I say 'device'. This is because BitTorrent Sync is cross platform, with versions available for Linux, Windows, OSX, FreeBSD, Android, and iOS, enabling you to grow your Sync network so that you have faster sync times.
More devices also gives you more data redundancy. For example, imagine that you have Sync set up on your smartphone, your laptop, and your desktop, and that your house burns down while you're out, destroying the laptop and desktop. Luckily, you have your smartphone inside of your pocket, and therefore haven't lost any of the data that you had Synced to the phone. This makes it not only a powerful data synchronization tool, but can also function as a sort of disaster recovery.
Of course, many will argue that cloud storage solutions such as Dropbox have the added benefit of preserving your data even if you lose all of your devices. While this is true, it also means that your data is no longer in your control. Moreover, purchasing a Virtual Private Server (VPS) from a service like Digital Ocean allows you to create an off-site sync location. This will give you blazing fast sync speeds, more control over your data, and a strong off-site storage solution.
The last great thing about BitTorrent Sync is the ability to create Read-Only Secrets. We'll learn about secrets soon, but essentially it allows you to share a folder with friends without them being able to modify your files.
Setting up BitTorrent Sync is fairly easy. The first step is to visit the BitTorrent website and download the appropriate installer for your system. I won't go over the install process as it's fairly straight-forward. Instead, I'll mainly focus on the concepts and key settings for BitTorrent Sync, as every client is slightly different.
If you're on Linux, the first thing that to do once BitTorrent Sync is installed is set a password for the program. This is to ensure that other people on your network can't access the client without authorization. To do this you'll have to generate then edit a JSON configuration file, most of which is explained here, on page 9. Also, to use BitTorrent Sync on Linux you'll have to crack open your browser, type in "localhost:8888/gui", and then work from there. If you're on Windows or OSX this shouldn't be an issue. Simply install the client and open the program.
The next step is to set up a folder to sync. When creating a Sync folder you'll be asked for a Secret and a Path. Since this is your first time using Sync click the "Generate" button to create a random secret. The Secret is the key to all your files. If you type your secret into another device, it will automatically gain access to all the files you have set up to sync. This can seem frightening at first, as anyone with that random string of characters can gain access to your files. However, the number of characters that BitTorrent Sync uses to generate these secrets means that the chances of successfully finding a single secret are astronomical.
Nevertheless, if you so desire you can set any length of secret. An easy way to generate an over-the-top random secret is to generate a secret, copy it, generate a new secret, and then paste it in to the new secret. Do this as many times as your heart desires, but know that even at the default length the secrets are quite secure.
Once you have generated a secret and selected a path to the folder you want to sync, all you need to do is copy that secret key to another device running BitTorrent Sync. Once two devices share the same key they'll start syncing back and fourth. It's a fairly easy process, especially considering that the mobile clients can be quickly synced with a QR code.
Privacy Enhanced Settings (Paranoid Mode)
Depending on your level of paranoia you may be inclined to change a few settings to ensure that your data is well protected.
- The first is to turn off the "Use Relay Server When Required" setting. The relay server is essentially a system to help your devices talk to each-other when behind restrictive firewalls. In other words, instead of device A talking to device B directly, the message is instead passed through one of BitTorrent's servers. While turning this off can sometimes cause problems syncing (although it has never been an issue for me), it's a simple step towards privacy for the ultra-paranoid among us, and keeps your data away from unnecessary parties.
Do note that all your data is encrypted before leaving your computer, so the relay server cannot see your data anyways (or so we are told).
- The next setting you can change is the use of the tracker server. The tracker server is a way for each of your devices to tell the network that they exist, and how they can be found. Changing this setting has arguable effects on privacy. Turning it off means that the chances of your devices actually finding each-other are made rather slim, unless you turn on the Distributed Hash Table (DHT) or set up your own host server (the best option, but it requires a static IP address).
The Distributed Hash Table is the most likely alternative that you'll use to the tracker server, but a minor downside to this is that it can reveal to adversaries which devices you have set up on your network, what their IP addresses are, and an encrypted version of your secret. In contrast, the tracker server reveals this same information, but only to the BitTorrent company itself. So take your pick here. Personally, I use the tracker server as I find it to be more reliable.
- The last option you may consider changing is searching LAN for other BitTorrent Sync devices. This option is probably safe to use at home and will make your syncs far faster. Using it on public wifi is again dependent on your level of paranoia. On one hand, for %99.99 of us it will never make a difference whether we turn this on or off. On the other hand, it tells everyone else on the network that you use BitTorrent Sync. So once again, take your pick.
That's the long and short of BitTorrent Sync. It's a great piece of software, and is easily the simplest way to regain control of your data from services like Dropbox and Drive. Be sure to check out the BitTorrent Sync User Guide, which explains how you can fine tune settings like frequency, max file size, port number, etc, to make your syncs happen exactly as you want them to.