Skip to content

Instantly share code, notes, and snippets.

@matijs
Last active June 13, 2019 09:03
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save matijs/9378953 to your computer and use it in GitHub Desktop.
Save matijs/9378953 to your computer and use it in GitHub Desktop.
Instructions and example configuration to install BitTorrent Sync on a Raspberry Pi running Arch Linux.

Installing BitTorrent Sync on a Raspberry Pi running Arch Linux

The commands below assume you're using a user that can use sudo, you're not logged in as root are you!?

First create a btsync user:

sudo useradd -M --shell /bin/false --home /var/lib/btsync

Download the btsync binary and put it in /usr/local/sbin.

Create /etc/btsync:

sudo mkdir /etc/btsync

Create a sample config or use the example one provided with this gist (don't forget to remove the comments in the .json file, I'm not sure if btsync chokes otherwise):

sudo /usr/local/sbin/btsync --dump-sample-config > /etc/btsync/btsync.json

Create /var/lib/btsync and change ownership:

sudo mkdir /var/lib/btsync
sudo chown btsync:root /var/lib/btsync

Create a systemd configuration file for btsync in /usr/lib/systemd/system/ or use the example one provided with this gist.

Enable btsync to be started at boot time:

sudo systemctl enable btsync

… and start btsync:

sudo systemctl start btsync

You should now be able to open a browser and go to http://servername:8888 and login using admin and password if you used the example config provided with this gist.

Make sure that any Folder that you want to add is readable and writeable by the btsync user.

{
"device_name": "Alarmpi",
"listening_port" : 0,
"storage_path" : "/var/lib/btsync",
"pid_file" : "/var/lib/btsync/btsync.pid",
"check_for_updates" : true,
"use_upnp" : true,
"download_limit" : 0,
"upload_limit" : 0,
"webui" : {
"listen" : "0.0.0.0:8888",
"login" : "admin",
"password" : "password"
}
}
[Unit]
Description=BTSync
After=network.target
[Service]
Type=forking
User=btsync
PIDFile=/var/lib/btsync/btsync.pid
ExecStart=/usr/local/sbin/btsync --config /etc/btsync/btsync.json
ExecStop=kill `cat /var/run/btsync/btsync.pid`
[Install]
WantedBy=multi-user.target
@B-Galati
Copy link

@matijs You forgot the last argument for useradd command
Otherwise thanks for this :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment