Skip to main content

rTorrent Server Setup

Last Updated: March 2, 2015

Server Specifications:

Debian 7

Nginx Web Server

rtorrent/rutorrent/libtorrent

Installing Prerequisites

apt-get update; apt-get install -y git build-essential automake libtool libcppunit-dev libcurl3-dev libsigc++-2.0-dev unzip unrar-free curl libncurses-dev nginx openvpn cifs-utils php5-fpm php5 php5-cli php5-json php5-curl libapache2-mod-scgi libxmlrpc-core-c3 libxmlrpc-core-c3-dev zlib1g-dev libssl-dev screen

Exclude OpenVPN and CIFS if you don't need them.

Installing libtorrent

mkdir /install;cd /install
wget http://rtorrent.net/downloads/libtorrent-0.13.6.tar.gz
tar -zxf libtorrent-*
cd libtorrent-*
./autogen.sh
./configure
make
make install

Installing rTorrent

cd /install
wget http://rtorrent.net/downloads/rtorrent-0.9.6.tar.gz
tar -zxf rtorrent-*
cd rtorrent-*
./autogen.sh
./configure --with-xmlrpc-c
make
make install
ldconfig

Installing ruTorrent

cd /var/www/
git clone https://github.com/Novik/ruTorrent.git rutorrent

Installing ruTorrent plugins

The plugins folder was downloaded in the git clone

Edit rutorrent/conf/plugins.ini

change enabled = user-defined to enabled = yes

Configure NGINX

cd /etc/nginx/sites-available/
rm default
wget https://raw.githubusercontent.com/nathanthorpe/Random/master/default

If you use this to run another web site you will need to edit this to your liking.

Mount the network share

mkdir /mnt/share
nano /etc/fstab

Add this line to fstab

//hostname/sharename   /mnt/share cifs username=username,password=password

Substitute the values for your own setup. Replace the last part with just guest if your share doesn't have a password.

Type this to mount the share

mount -a

Configure OpenVPN

Create an OpenVPN configuration file for your VPN provider.

Example:

cd ~
nano config.ovpn

client
dev tun
proto udp
remote us-east.privateinternetaccess.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
tls-client
remote-cert-tls server
auth-user-pass auth.txt
comp-lzo
verb 1
reneg-sec 0

Put your username and password in a file called auth.txt

Username
Password

Make a startup script and run it

screen -S vpn openvpn --config config.ovpn > vpn.sh

sh vpn.sh

Set up the rtorrent configuration

cd ~/
wget https://raw.github.com/nathanthorpe/Random/master/.rtorrent.rc

Edit the directory and session line that goes with your folder structure.

Start rTorrent

screen -fa -d -m rtorrent

You can also make that into a script.