How to Install Resilio Sync on Ubuntu 16.04 and Ubuntu 16.10

Resilio Sync, formerly known as BitTorrent Sync, is a free, fast, peer-to-peer file sharing and syncing tool released by Resilio, Inc. It’s available for Linux, Mac, FreeBSD, Windows, Android, iOS and NAS devices. The latest stable version was 2.4.4, released on December 9, 2016. In this tutorial, we’re going to look at how to install Resilio Sync on Ubuntu 16.04 and Ubuntu 16.10.

Installing Resilio Sync on Ubuntu 16.04 and Ubuntu 16.10 via Official Repository

Open up a terminal window and edit the sources.list file with nano or your preferred text editor.

sudo nano /etc/apt/sources.list

Append the following APT line at the end of this file.

deb http://linux-packages.resilio.com/resilio-sync/deb resilio-sync non-free

install resilio sync ubuntu

Save and close the file.

In order for APT to authenticate packages from the above repository, we need to import Resilio Sync’s public key. First download the public key with wget.

wget https://linux-packages.resilio.com/resilio-sync/key.asc

Then import the public key with apt-key.

sudo apt-key add key.asc

Now let’s update local package index and install Resilio Sync.

sudo apt update

sudo apt install resilio-sync

Managing Resilio Sync

To start Resilio Sync, use systemctl command.

sudo systemctl start resilio-sync

And enable auto start at boot time using the following command:

sudo systemctl enable resilio-sync

Check its status.

systemctl status resilio-sync

resilio sync ubuntu

Once running, The Resilio Sync daemon will listen on 127.0.0.1:8888 as specified in /etc/resilio-sync/config.json configuration file.

Now you can type the following in your web browser address bar to access the Resilio Sync Web UI.

127.0.0.1:8888

You will be asked to set a username and password to secure the Web UI.

resilio sync linux

Then choose a name for your device and click Get started.

resilio ubuntu

Next, click the Add Folder link on the upper left corner to choose your shared folder.

install resilio sync linux

You might encounter the following error message. That’s because Resilio Sync is running as rslsync user.

Don’t have permissions to write to selected folder.

Let’s say you selected your home folder /home/your-username/ as the shared folder. To fix the above error, all you need to do is to grant permissions on your home folder to the rslsync user with the following command.

sudo setfacl -R -m "u:rslsync:rwx" /home/your-username

The above command won’t change the owner of the shared folder. The owner has the same permissions as usual. What it does is to grant read, write and execute permissions to one more user, namely rslsync.

Now you should be able to add your home folder as the shared folder.

Using Resilio Sync on Ubuntu 16.04, 16.10 Server

By default, Resilio Sync only listens on 127.0.0.1:8888. So if you install Resilio Sync on Ubuntu 16.04/16.10 server, you won’t be able to access the Web GUI from your local computer. To be able to access the Web GUI from a remote connection, we can set up Nginx reverse proxy for Resilio sync.

First install Nginx on Ubuntu 16.04, 16.10 server.

sudo apt install nginx

Start Nginx and enable auto start.

sudo systemctl start nginx

sudo systemctl enable nginx

Then create a server block file under /etc/nginx/conf.d/.

sudo nano /etc/nginx/conf.d/rslsync.conf

Paste the following lines in the file. Replace sync.yourdomain.com with your real domain name. You should also add an A record that point your domain name to the IP address of your Ubuntu 16.04, 16.10 server.

server {
  listen 80;
  server_name sync.yourdomain.com;

  access_log /var/log/nginx/sync.yourdomain.com.log;
  location / {
    proxy_pass http://127.0.0.1:8888;
  }
}

Save and close this file. Reload Nginx.

sudo systemctl reload nginx

Now in your browser’s address bar type your domain name and you should be able to access the Web GUI.

Secure the Resilio Sync Web GUI by Installing a TLS Certificate

To prevent hackers sniffing username and password, you can acquire and install a TLS certificate. As you may already know, Let’s Encrypt now provide free TLS certificate which can be easily obtained and installed.

Here’s how to install and configure Let’s Encrypt TLS certificate with Nginx on Ubuntu 16.04, 16.10 server.

Install letsencrypt

sudo apt install letsencrypt

Create a directory for Let’s Encrypt verification.

sudo mkdir /var/www/sync.yourdomain.com/

Set www-data as the owner of this directory.

sudo chown www-data:www-data /var/www/sync.yourdomain.com/ -R

Add the following directive in /etc/nginx/conf.d/rslsync.conf file.

location ~ /.well-known/acme-challenge {
        root /var/www/sync.yourdomain.com/;
        allow all;
}

Save and close the file. Reload Nginx for the changes to take effect.

sudo systemctl reload nginx

Then issue the following command to obtain certificate. Replace red text with your actual data.

sudo letsencrypt certonly --webroot --agree-tos --email your-email-address -d sync.yourdomain.com -w /var/www/sync.your-domain.com/

Within a few seconds, you should see a congrats message like below which means the certificate is successfully obtained.

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at
   /etc/letsencrypt/live/sync.yourdomain.com/fullchain.pem. Your cert
   will expire on 2017-05-09. To obtain a new version of the
   certificate in the future, simply run Let's Encrypt again.
 - If you like Let's Encrypt, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

Next, let’s configure Nginx TLS/SSL settings. Open /etc/nginx/conf.d/rslsync.conf again.

sudo nano /etc/nginx/conf.d/rslsync.conf

Change the content of this file to the following. Replace sync.yourdomain.com with your real domain name.

server {
  listen 80;
  server_name sync.yourdomain.com;
  return 301 https://$server_name$request_uri;
}
server {
  listen 443 ssl http2;
  server_name sync.yourdomain.com;

  ssl_protocols TLSv1.1 TLSv1.2;
  ssl_certificate /etc/letsencrypt/live/sync.yourdomain.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/sync.yourdomain.com/privkey.pem;

  access_log /var/log/nginx/sync.yourdomain.com.log;
  location / {
      proxy_pass http://127.0.0.1:8888;
  }

  location ~ /.well-known/acme-challenge {
     root /var/www/sync.yourdomain.com/;
     allow all;
   }
}

Save and close the file. Test Nginx configuration and reload.

sudo nginx -t

sudo systemctl reload nginx

Go to your Resilio Sync Web GUI again, you will find HTTP connection is automatically redirected to HTTPS secure connection.

Cheers!

I hope this tutorial helped you install Resilio Sync on Ubuntu 16.04 and Ubuntu 16.10 desktop or server. As always, if you found this post useful, then subscribe to our free newsletter. You can also follow us on Google+ Twitter or like our Facebook page.

Rate this tutorial
[Total: 11 Average: 4.4]