Easy rTorrent + ruTorrent Installation And Configuration Script For Debian Or Ubuntu

rtorrent + rutorrent debian seedbox

Installing and setting up rTorrent and ruTorrent on an Ubuntu or Debian server can be a complicated, tedious task, specially for inexperienced users. rtinst is a script that makes this easier, by automatically installing and configuring rTorrent, ruTorrent (stable or master), and everything else needed for an Ubuntu or Debian (including on Raspberry Pi) seedbox.

The script was updated recently with some important improvements, like support for the latest Debian 10 (buster) stable release, and automatic Let's Encrypt certificates generation if possible (in case it fails, it falls back to self-signed certificates).

rTorrent is a text-based ncurses BitTorrent client based on libTorrent, great for usage on servers, while ruTorrent is a web front-end for rTorrent.

The rtinst script installs and configures:

  • vsftpd (ftp server)
  • libTorrent/rTorrent/xmlrpc-c (installed from source, to enable xmlrpc-c support in rTorrent so it can be remote controlled using ruTorrent)
  • ruTorrent (web interface for rTorrent)
  • NGINX (webserver)
  • autodl-irssi (a plugin for irssi that monitors IRC announce channels and downloads torrent files based on user-defined filters)
  • Webmin (a web-based system configuration tool for Unix-like systems; optional)

As for supported Debian and Ubuntu versions, the script supports Debian 9 "Stretch", Debian 10 "Buster", Ubuntu 16.04, 18.04 and 19.04 (the the script page also mentions Ubuntu "17", but both Ubuntu 17.04 and 17.10 are not supported by Canonical for quite a while). [[Edit]] The rtinst scripthas been updated to support Ubuntu 20.04.

Being created as a complete solution for installing everything you need to create your own Ubuntu or Debian seedbox, rtinst doesn't allow skipping the installation and configuration any of these packages, except Webmin.

rtinst also includes a series of admin scripts to easily perform some tasks, like rtupdate to upgrade (or downgrade) libtorrent/rtorrent, rutuupgrade which can be used to upgrade ruTorrent (retaining your config and settings, and offering a way to rollback the changes), and others.

I tested the script on Ubuntu 18.04 and Debian 10, and the rTorrent + ruTorrent (and everything else) installation and configuration went smoothly (I did encounter one issue, but the developer fixed it).

Quick rTorrent & ruTorrent installation guide on Debian or Ubuntu using rtinst

Warning: Always check the code of the scripts you run on your system, especially when running them as root!

1. Download and setup rtinst.

Start by downloading the latest rtinst and running its initial setup using the following command, which works on Debian 9 "Stretch" or 10 "Buster / Ubuntu 20.04, 19.10, 18.04 or 16.04:

sudo bash -c "$(wget --no-check-certificate -qO - https://raw.githubusercontent.com/arakasi72/rtinst/master/rtsetup)"

2. Use rtinst to install and configure rTorrent, ruTorrent (with libTorrent and xmlrpc-c), vsftpd, NGINX and autodl-irssi.

Now let's run rtinst and start the rTorrent and ruTorrent (and the rest of tools already mentioned above) installation and configuration process (don't run the command just yet - check out the explanations below first!):

sudo rtinst --log --webpass RUTORRENT_WEB_PASSWORD --dload

An explanation of what those options mean:

  • -l, --log Enables logging to ~/rtinst.log so you can debug this in case something goes wrong
  • -w, --webpass Sets the web password for the user. This is the password used by rutorrent, and is not the same as the unix account password
  • -d, --dload Enables http download of content

For the complete list of possible rtinst options, please visit the rtinst guide.

[[IMPORTANT]] For security reasons, rtinst assigns a new SSH port by default, which is shown at the end of the installation process (it can also be found in ~/rtinst.info), and disables root login over SSH. If you don't the SSH port changed, you can add --ssh-default to the command so the SSH port is set to its default (port 22).

After running the rtinst command, all you have to do is follow the steps shown by the script, and at the end reboot the system. DO NOT REBOOT the system, and don't close the current SSH session if you didn't use the default SSH port option, until you make sure you can SSH into your server! If you allowed rtinst to change the SSH port, you'll need to use ssh -p PORT USER@HOST to connect.

At the end of the installation and configuration process, rtinst will also show you other useful information, like the FTP port (for security reasons, the script assigns a random port for this too), the address at which you can access ruTorrent, the HTTPS downloads location (if enabled), and more. Note everything down and keep it somewhere safe.

rtinst also offers the possibility of installing Webmin, and configuring NGINX as a reverse proxy allowing Webmin access using https://SERVER-IP/webmin. This is optional and you can start the Webmin auto installation and configuration using:

sudo rtwebmin

4. Reboot the system

Now you can reboot the system:

sudo reboot

There's a new libTorrent/rTorrent version available and you want to upgrade to it? Run:

sudo rtupdate

Want to upgrade to a newer ruTorrent version? Use:

sudo rutupgrade