How to: create a secure cloud with BitTorrent Sync & Amazon EC2

512h-bt-sync-lockup

In Sync Hacks, we spotlight cool uses of Sync from the creative minds of our users. Sync is our free, unlimited, and secure file-syncing application. If you have an interesting use or how-to, shoot us an email at sync[at]bittorrent.com. Can’t wait to hear what you guys cook up.

In this edition of Sync Hacks, we have Sam Glover’s great tutorial on how to create your own personal “Dropbox” using BitTorrent Sync and Amazon EC2. Why Sam chose BitTorrent Sync? Because it’s decentralized, secure, and private. Read on to learn how Sam used BitTorrent Sync and Amazon EC2 to create his own personal cloud.

On choosing BitTorrent Sync

File sync is awesome. Without the ability to get at my files on all my computers (4, currently), I don’t know how I would function. That said, I’m not super-fired-up about Dropbox’s security and privacy practices (or Google Drive’s, for that matter), particularly in light of recent news.

So I got pretty excited when I learned about BitTorrent Sync, software that syncs your files without requiring you to give the key to those files to a company like Dropbox or Google. Like its namesake, BitTorrent Sync is decentralized. It syncs files between the computers you install it on, and does not rely on any central server.

Your own server with Amazon EC2

Unfortunately, the lack of a central server is also a downside. If you have a desktop and laptop, for example, BitTorrent Sync will only sync up your files when both of your computers are turned on and connected to the Internet. That’s not a problem with Dropbox, because Dropbox’s servers keep your files synced up all the time, even if your computers are never connected to the Internet at the same time. But if you got BitTorrent Sync running on your own server, you could get this same functionality.

That’s why I figured out how to install BitTorrent Sync on an Amazon EC2 server. Here’s how I did it (with crucial help from the friendly folks on #ubuntu-server at freenode).

Step 1: Install BitTorrent Sync on your computer

Go to the BitTorrent Sync page and download BitTorrent Sync for your computer. Install it in the usual way for your operating system, and run it. Go ahead and accept all the defaults.

You will wind up with a /BTSync folder in your home directory. You can also create other folders to sync and share, but this one will get you started.

Step 2: Provision a new Ubuntu server instance

This sounds harder than it is. Amazon has added a “quick launch” option for dummies like me that makes creating a new server trivial.

Create an account at aws.amazon.com. This should take 5–10 minutes, counting the time it takes to verify your account over the phone.

Once your account is set up (you will get an email notifying you that you are good to go), go to your EC2 Dashboard and click the Launch Instance button. Then, select Quick Launch Wizard on the left in the pop-up window. This allows you to provision a new server without having to mess around with all the settings.

Now, enter a name for your server. “BitTorrent Sync Server” will do just fine.

Under Choose a Key Pair (which you will need to download and use in the next step), Create New should be pre-selected. Enter a name. “btsync-keypair”, for example. Click the Download button to download your key pair, and make sure you will be able to find it again.

Under Choose a Launch Configuration, select the Ubuntu Server option that has LTS in the name, and leave the 64-bit radio button selected. LTS stands for “long term support,” which means you will get security updates from Canonical for 5 years, which means you don’t have to worry about upgrading your server’s operating system any time soon.
Click the Continue button, and voila!

Step 3: Install BitTorrent Sync on your new server

Go to the BitTorrent Sync page and copy the link to the correct download. (Use the Linux x64 link if you installed a 64-bit Ubuntu server like I told you to.)

Find the rest of the steps on Sam Glover’s personal blog.

Sam Glover (samglover) writes about law practice (lawyerist.com) and digital assets (estatedispatch.com) for a living. He also likes espresso and fountain pens. You can follow his personal blog here.