Install BitTorrent Sync on Debian / Ubuntu Server

First we need to add the repository to the sources.list. Run the following commands as root.

apt-key adv –keyserver keys.gnupg.net –recv-keys 6BF18B15
CODENAME=$(lsb_release -cs | sed -n ‘/lucid\|precise\|quantal\|raring\|saucy\|trusty\|squeeze\|wheezy\|jessie\|sid/p’)
echo “” >> /etc/apt/sources.list
echo “#### BitTorrent Sync – see: http://forum.bittorrent.com/topic/18974-debian-and-ubuntu-server-packages-for-bittorrent-sync-121-1/” >> /etc/apt/sources.list
echo “## Run this command: apt-key adv –keyserver keys.gnupg.net –recv-keys 6BF18B15” >> /etc/apt/sources.list
echo “deb http://debian.yeasoft.net/btsync ${CODENAME:-sid} main” >> /etc/apt/sources.list
echo “deb-src http://debian.yeasoft.net/btsync ${CODENAME:-sid} main” >> /etc/apt/sources.list
unset CODENAME
apt-get update
apt-get -y install btsync

This will fetch the GPG keys for the custom repository, it will then amend your sources list by the new repositories (you can disable the src repository if you want) and finally it installs the server version of BitTorrent Sync as provided by tuxpoldo.

You will then be asked if you want to define a default BitTorrent Sync instance or not. The difference is that with the default instance you run BitTorrent Sync only lets you run BitTorrent Sync as root or btsync user. However if you have for example an existing Samba installation or something else that you want to use to sync data, you might not want to run it as default instance.

If you choose to install as default instance then just accept all the default options except for UPNP. I think that should be enabled in either case.

 

If you choose not to run a default instance then you need to manually create the user config file. There are samples in the /etc/btsync/sample folder but I’d like to provide an own below. Run as root (and maybe alter the file name):