Sync Hacks: How to Set Up BitTorrent Sync on a Synology NAS

Sync Hacks is a column dedicated to exploring new applications for BitTorrent Sync, as built by users like you. BitTorrent Sync is a free, unlimited, secure file-syncing app. (And now, it’s 2X faster.) If you’ve got an epic Sync idea, use-case or how-to, shoot us an email at sync[at]bittorrent.com.

Synology

In this week’s Sync Hacks, Torben Stallknecht walks us through how to set up BitTorrent Sync on a Synology Network Attached Storage (NAS) to access large files from anywhere.

This post is adapted from Torben’s original tutorial found here.

From Torben:

Before you start

1. In order to setup Bittorent Sync on your NAS, please make sure that your NAS has a supported CPU. To find out which CPU your NAS has, look here.
2. This guide assumes the following reparation and knowledge: This includes router setup and firewall configuration. You will need port 8888 to be open and forwarded to your NAS.

Setting up a user

Because we do not wish to run the Sync service as root, we will be setting up a user.

Adding the user
This portion should be something you know about, so I have not gone into detail about this. As long as you just create a standard user, the rest of my guide should fit your needs.

Enabling user to login to SSH/Terminal
The default behavior for new users on the Synology NAS is that they are not allowed to login through SSH. This is easily resolved by altering the /etc/passwd file.
To do this-
1. Login to you NAS using SSH
2. Perform the command: vi /etc/passwd Find the line with your BitTorrent Sync user listed.
3. Here, change the last part of the line, where it says: /sbin/nologin this needs to say /bin/sh
4. Now, you do not need to logout just yet, to get started.
5. In order to get started with the btsync user, simply issue the command: su – btsync

Setting up BitTorrent Sync

By default you will be sent to the home directory of the BitTorrent Sync user. We want this.
1. Now we are going to create some folders. I use two folders. A bin folder and a conf folder.

mkdir bin 
mkdir conf

2. Next, get a hold of the latest build that fits your needs. For my DS-1513+, it is build 1.2.82. We will aquire the build using wget. For the current build, the url is http://download-lb.utorrent.com/endpoint/btsync/os/linux-glibc23-x64/track/stable/btsync_glibc23_x64.tar.gz
Please notice, that I need to get the glibc23 version, as Synology ships their OS with this old version of GLIBC for the DS-1513+. To check which version of GLIBC your NAS has, issue the following command:

/lib/libc.so.6

It will give you something along the lines of: (BOLD text indicating version of GLIBC) GNU C

Library stable release version 2.3.6, by Roland McGrath et al.

If the version is 2.4 or above, you are free to get the full build:
http://download-lb.utorrent.com/endpoint/btsync/os/linux-glibc23-x64/track/stable/btsync_x64.tar.gz

3. Get the file into the bin folder

cd bin

In order to get the file, issue the command

wget http://download-lb.utorrent.com/endpoint/btsync/os/linux-glibc23-x64/track/stable/btsync_glibc23_x64.tar.gz

4. Once we have the file downloaded, we want to extract it.

tar xvf btsync_glibc23_x64.tar.gz

Two files are then extracted.

Btsync
LICENSE.TXT

5. Now we want to get the configuration, so that we get the system set up as we want. In order to generate the default configuration file, issue the command.

./btsync --dump-sample-config > ../conf/sync.conf

Change the sync.conf fil to fit your needs. The main things you want to change, is the device_name and the credentials under webui. Also, you might want to change the storage_path. For my setup, I have simply commented the line, as the app then automatically adds the folder with the auxiliary files, in the bin folder.

6. Once this is done, it is time to fire up the app.
Move into the bin folder, and issue the command:

./btsync --config ../conf/sync.conf

7. Now, in your browser, enter

http://:8888/gui – in my case: http://192.168.10.5:8888/gui

And enter the credentials you added to the sync.conf file

You are ready to start setting up shared folders on your NAS.

Screen Shot 2014-01-21 at 3.17.45 PM

Torben Stallknecht is a Danish “hobby” programmer, mainly working with C#.NET, PHP and most of the things around it. (Various SQL-servers etc.) You can reach him by email at torben@hamdenkloge.dk

Lou
Written by: Lou

Lou is a product marketing manager at BitTorrent, Inc., where he works on BitTorrent Sync, a free app that allows you to sync and share large files with anybody via secure, distributed technology.

 Related Posts:
  • Charly

    Is this any different from using http://packages.synocommunity.com/?

  • Boris Shor

    I don’t understand why one would want to install BTSync this way through the command line. Why not simply use the community package for BTSync (http://www.synocommunity.com/packages)? It’s a one-click install and it has been running fine for me for months.

  • Torben Stallknecht

    Boris,

    I can understand, why you don’t understand this.

    A few things.
    For one, using the way mentioned in the guide, gives you the “full power”.
    This with regards to not only configuration, but also with regards to always having the latest build.
    With the package you mention, you rely on the package compilers, to always deploy a new build.
    That being said, the guide was made WAY before the package you mention was available.

  • Little John

    Is it just me, or is the synocommunity site down?

    • http://www.skooterblog.com/ Skooter Blog

      It’s down. And there is no other place to get the BTSync package.

      • Little John

        Does anyone know why it’s down? Or if it will be coming back up?
        You can manually install it, but I much rather just have a repository……

        • http://www.skooterblog.com/ Skooter Blog

          They are changing the server. It will be back, but they don’t know when.
          The source of their packages are available on their GitHub, but building them is kinda tricky. It took me a few hours yesterday to build the last BTSync package. But I think it’s still better than manually installing. At least it will be easy to apply future updates when the community is back online.

          • Little John

            I’m glad to hear they’ll be back, freaked me out when the I didn’t see any of the packages show up in the community….

  • Aaron Hilliard

    I got through step 4 with no problems, but then hit a snag when I copy/pasted your command for step 5.

    ./btsync –dump-sample-config > ../conf/sync.conf

    Gave me the following error message:

    ./btsync: line 1: syntax error: unexpected word (expecting “)”)

    Any idea why? I’d really love to get this up and running, any help would be appreciated!

    Thanks

  • Toff

    Hi, I installed the package from Synocommunity but to my disappointment there was no function to install the latest version, so I was pleased to find your instructions, thanks for sharing :o)

    All has installed perfectly, I have two questions:
    1. How can I script this to run automatically each time the Synology reboots please?
    2. Having set-up as per your instructions, can I disable Telnet and SSH in the Synology Control Panel (for the sake of security) or is it needed by BTSync?

    Thanks in advance

    PS: I have the DS213j – so I used the ARM BTSync build 1.3.106

  • Toff

    Hi,

    The main difference is: the package uses the same underlying software (BTSync) but it’s an older version.

    You’ll have to wait for the makers of the package to incorporate the latest release of BTSync and then publish it as an update for the Synology app.

    If you want the latest release now; you can deploy it yourself using Torben’s instructions.

    Al.

  • Phusebox

    I tried using the guide, and using the package center for installation. Only the package center worked, but after rebooting my DS414 the BTsync settings are all gone. I have to add all the folders again, and this takes several hours to complete each time.

    I ran into a problem someone mentioned below when following the guide (./btsync: line 1: syntax error: unexpected word (expecting “)”)). So that is not working for me, and other people obviously.

    Anybody know what I need to do to prevent my settings from dissapearing after a reboot?