BTSync on AWS EC2

Objective: Allow Ubuntu to start BTSync on reboot.


  1. create an EC2 instance, with appropriate storage space.
    • Ubuntu LTS 64bit (currently 14.04)
  2. download the BTSync client
  3. dump the btsync.conf
    1. ./btsync –dump-sample-config > btsync.conf
  4. edit the btsyn.conf for your settings.
  5. sudo su
  6. create /etc/init.d/btsync file
    • See below
  7. chmod 755 /etc/init.d/btsync
  8. update-rc.d btsync defaults
  9. service btsync start
  10. test the connection against other boxes.


  1. Since we’re on EC2, and security is paramount.
  2. Establish a port tunnel
    1. sudo ssh -i ~/.ssh/EC2KEY.pem -L 8888: ubuntu@serverHostNameOrIP
  3. Connect to the system via:
  4. Verify that all is working on the server end.



  1. Connect w/the shared keys.
  2. Verify that the system is working.
  3. Put a file into the shared folder. Notice that the file should go up to the server.


On the Server EC2 instance.

create the file /etc/init.d/btsync

# /etc/init.d/btsync
# @see: source
if (( $EUID != 0 )); then
    echo "Please run as root"
# Carry out specific functions when asked to by the system
case "$1" in
    /USERACCOUNT/.btsync/btsync --config /USERACCOUNT/.btsync/btsync.conf
    killall btsync
    echo "Usage: /etc/init.d/btsync {start|stop}"
    exit 1
exit 0

Update 2014-08-23

  • changed the init.d script to bash, and added root check.
  • Noticed that BTsync does not work well over a VPN connection.

Leave a Reply

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