Install ruTorrent (Debian 8) NGINX, PHP-FPM, rTorrent – How-to

This is a diagram of my preferred setup that this tutorial will guide you through.

Install rTorrent, ruTorrent, NGINX PHP-FPM - Debian 8 (Jessie) - How-to

I assume you are logged in as root and running Debian 8 (Jessie).

Update available packages and upgrade your system.

apt-get update -y
apt-get upgrade -y

Create the user that will be running rtorrent. In this case the user will be ‘seedbox’.

adduser seedbox
passwd seedbox

Install rTorrent

I’m using my rTorrent config for this install. (VIEW CONFIG HERE).

apt-get install -y rtorrent unzip unrar-free mediainfo curl libav-tools screen
# avtools needs to be linked to ffmpeg for rTorrent
ln -s /usr/bin/avconv /usr/bin/ffmpeg
mkdir -p /home/seedbox/rtorrent/{.session,watch}
wget --no-check-certificate -O /home/seedbox/.rtorrent.rc
chown -R seedbox:seedbox /home/seedbox

Add rTorrent to startup

wget --no-check-certificate -O /etc/init.d/rtorrent
chmod +x /etc/init.d/rtorrent
update-rc.d rtorrent defaults
/etc/init.d/rtorrent start

Install NGINX PHP-FPM and self-signed SSL certificate

I’m using my NGINX config for this install. In the commands and config replace NAME with your host name. (VIEW CONFIG HERE).

apt-get install -y nginx php5-fpm php5-cli php5-geoip apache2-utils openssl
wget --no-check-certificate -O /etc/nginx/sites-available/rutorrent-hostip-ssl
cd /etc/nginx/sites-enabled
rm default
ln -s ../sites-available/rutorrent-hostip-ssl
htpasswd -c /var/www/html/.htpasswd seedbox
chown www-data:www-data /var/www/html/.htpasswd
service nginx reload

Create SSL directories

mkdir /etc/nginx/ssl
mkdir /etc/nginx/ssl/NAME
cd /etc/nginx/ssl/NAME

Generate SSL key

openssl genrsa -out "/etc/nginx/ssl/NAME/NAME.key" 2048

Create SSL request

openssl req -new -key "/etc/nginx/ssl/NAME/NAME.key" -out "/etc/nginx/ssl/NAME/NAME.csr"

Validate SSL request and create SSL certificate

openssl x509 -req -days 1825 \
    -in "/etc/nginx/ssl/NAME/NAME.csr" \
    -signkey "/etc/nginx/ssl/NAME/NAME.key" \
    -out "/etc/nginx/ssl/NAME/NAME.crt"

Install ruTorrent

apt-get install -y git
git clone /var/www/html/rutorrent
wget --no-check-certificate -O /var/www/html/rutorrent/conf/config.php
chown -R www-data:www-data /var/www/html/

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s