MainInstall - Novik/ruTorrent GitHub Wiki

rtorrent install

Quick installation

Since version 0.7.8 of rtorrent, most distros have compiled rtorrent with xmlrpc-c. If you are using a relatively current distro (e.g. Ubuntu 18.04LTS or newer) installation is as simple as using your package manager. It's recommended to use the latest version of rTorrent, so you can check your distro version in this way:

apt-get update
apt-cache show rtorrent | grep Version

If this version suits good for you, you can install with:

apt-get install rtorrent

Once installed you can proceed to configure rtorrent

Long installation

If you want the latest version of rTorrent, you can compile it by yourself. Only advanced users should do this.

Dependencies:

Compile and install xmlrpc-c

It's recommended that you use a newer version of xmlrpc-c. We use the svn stable version in this guide.

svn co http://svn.code.sf.net/p/xmlrpc-c/code/stable xmlrpc-c
cd xmlrpc-c
./configure
make
make install

Compile and install libtorrent

Now you can compile and install libtorrent as follows:

cd ~
wget http://rtorrent.net/downloads/libtorrent-0.13.8.tar.gz
tar -zxvf libtorrent-0.13.8.tar.gz
cd libtorrent-0.13.8
bash autogen.sh
./configure
make
make install

Compile and install rTorrent

Now you can compile and install rTorrent as follows:

cd ~
wget http://rtorrent.net/downloads/rtorrent-0.9.8.tar.gz
tar -zxvf rtorrent-0.9.8.tar.gz
cd rtorrent-0.9.8
bash autogen.sh
./configure --with-xmlrpc-c
make
make install

On a FreeBSD system with Ports installed, all of the above can be done with a single line of code:

cd /usr/ports/net-p2p/rtorrent/ && make install clean

rTorrent Configuration

rTorrent can be run as any user (or multiple users). Generally, it's a bad idea to run rtorrent as the root user, so create a unique user, and make sure to add a configuration file (.rtorrent.rc) in the home folder. According to Official rTorrent configuration guide, proceed in this way:

curl -Ls "https://raw.githubusercontent.com/wiki/rakshasa/rtorrent/CONFIG-Template.md" \
    | sed -ne "/^######/,/^### END/p" \
    | sed -re "s:/home/USERNAME:$HOME:" >~/.rtorrent.rc
mkdir -p ~/rtorrent/

Make sure to enable rpc socket, uncomment these lines of .rtorrent.rc

system.daemon.set = false
network.scgi.open_local = (cat,(session.path),rpc.socket)
execute.nothrow = chmod,770,(cat,(session.path),rpc.socket)

The rpc socket will be created at ~/rtorrent/.session/rpc.socket

Please note that newer version of rTorrent config file prefer to use rpc socket instead of host and SCGI port. This behaviour is recommended because it's easier and safer. If you prefer old behaviour, add this line to your config file:

network.scgi.open_port = 127.0.0.1:5000

rTorrent usage

If you have chosen to run rTorrent as an application (system.daemon.set = false), you can simply run the program to see if it works well:

rtorrent

It's better run rTorrent as a service (system.daemon.set = true). You can keep running program in background in this way:

daemonize $(which rtorrent)