BitTorrent Sync On Ubuntu

Overview

BitTorrent Sync or BT Sync uses BitTorrent technology to facilitate peer to peer file synchronization. It allows almost true peer to peer setup without a central server (except for a tracker). Clients can come on and offline as an when and so long as there is 1 up to date service containing the files then it will transfer them across when needed.

Install

I’ve tested this on a Ubuntu 14.04 server edition:

Add a PPA to the repository list:
sudo add-apt-repository ppa:tuxpoldo/btsync -y

Fetch updates now that there’s a new repository added:
sudo apt-get update

Install BT Sync:
sudo apt-get install btsync
During the install it will ask if you want to setup BT Sync from the command line. You can always reconfig it again by running:
sudo dpkg-reconfigure btsync

The initial setup wizard will be a cut down version of the dpkg-reconfigure so below should cover the extended version:

Define default Sync Instance
Select Yes to Do you want to define a default BitTorrent Sync instance?. BT Sync allows multiple instances of BT Sync to run for example if you want to setup a per user config for example but it’s beyond the scope of this post.

BitTorrent Sync Daemon Credentials
Select btsync for BitTorrent Sync Daemon Credentials:. This will mean btsync user will need access to the directory it will be syncing. An alternative to btsync account would be the user who owns the directory if the system only has one real user.

BitTorrent Sync Daemon Group
Select default for BitTorrent Sync Daemon Group:

Niceness of the BitTorrent Sync Daemon
Set Niceness of the BitTorrent Sync Daemon: to 0. This affects how much computer resources it uses. 0 is let BT Sync decide.

The visible name of this instance
The visible device name of this instance can be set to any friendly name to name the “device”.

BitTorrent Sync Listen Port
BitTorrent Sync Listen Port is the port it will use to sync on. This means it will require this port to be opened on the router if necessary.

External port number reported to the tracker
External port number reported to the tracker is the port number used to talk to the tracker. I left this as 0

Do you want BitTorrent Sync to request port mapping via UPNP
Set No for UPNP (I’ve never been a fan but if you’re lazy then set this to Yes so you don’t have to configure the router’s port settings).

Download Bandwith Limit
I left the download speed limit to unlimited (0).

Upload Bandwith Limit
I left the upload speed limit to unlimited (0).

Web Interface Bind IP Address
Leave the Web Interface Bind IP Address to be 0.0.0.0.

Web Interface Listen Port
Set the Web Interface Listen Port to either 80 (default web port as long as there are no other service running on the same port) or some other desire port. In this case I left it as 8888. This port is to allow web management of BT Sync settings.

The username for accessing the web interface
Set the username for the admin web management page.

The password for accessing the web interface
Set the password for the admin account.

BitTorrent Sync API Key
Leave the BitTorrent Sync API Key empty.

Umask value to set for the daemon
Set 002 for the Umask value. 002 will give the owner and group full access to files and only read and execute to other users. Change this according to your needs.

Should BitTorrent Sync perform disk operations with low priority
Select Yes for Should BitTorrent Sync perform disk operations with low priority? This will de-prioritise disk writes from BT Sync so if there are a lot of files to sync it should have less impact on the system.

Should BitTorrent Sync encrypt data on the local network
Answer Yes to Should BitTorrent Sync encrypt data on the local network.

Should BitTorrent Sync use TCP on the local network
Select Yes to Should BitTorrent Sync use TCP on the local network. TCP should be more reliable form of connection because it will receive acknowledgements to sent data.

Should BitTorrent Sync apply speed limites also in local networks
If you want to limit the speed for local peers then select Yes to Should BitTorrent Sync Apply speed limits also in local network. I select No.

Fall back folder rescan interval in seconds
Fall back folder rescan interval in seconds. I cut this number down from 600 (10 minutes) to 150 (2 min, 30 secs).

Leave the following options empty to let BT Sync use the default:

Debug logfile size in MB
Leave the Debug logfile size in MB to 10.

After all that you can go to your bowser and setup the folders through the web at http://myServer:8888 replacing myServer with the server address.

Summary

I’ve found BT Sync to work really well and fast but the documentation is very bad especially for running it on the server. Bear in mind this is still in beta at the time of writing so make sure you have backup of the data.

How To Use BitTorrent Sync to Synchronize Directories in Ubuntu 12.04

About Danny

I.T software professional always studying and applying the knowledge gained and one way of doing this is to blog. Danny also has participates in a part time project called Energy@Home [http://code.google.com/p/energyathome/] for monitoring energy usage on a premise. Dedicated to I.T since studying pure Information Technology since the age of 16, Danny Tsang working in the field that he has aimed for since leaving school. View all posts by Danny → This entry was posted in Linux, Software and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *.

All comments must go through an approval and anti-spam process before appearing on the website. Please be patience and do not re-submit your comment if it does not appear.

This site uses Akismet to reduce spam. Learn how your comment data is processed.