Sei sulla pagina 1di 8

Ace @ HDTS

Nov 10 2016

Online.net - Abridged Guide to Setting up Plex,


Sonarr, and ruTorrent on Debian 8

1
Ace @ HDTS
Nov 10 2016

Getting Started

This guide assumes you are utilizing an Online.net server with a fresh installation of Debian 8. This guide can
be adapted to suit a variety of servers/distributions, but specific adaptations are not outlined in the guide.
There should be minimal differences however, so feel free to explore and learn!

By default, Debian 8 does not allow root login from remote. You will need to launch KVM over IP and use the
local console to login to root. From there you can install sudo and give your user root privledges.
apt-get update && apt-get upgrade && apt-get install sudo

adduser <username> sudo

You can now exit the KVM console and connect to your user account via putty. Your user account will now be
able to execute commands with the required elevated privileges.

2
Ace @ HDTS
Nov 10 2016

Installing libTorrent 0.13.6/rTorrent 0.9.6, vsftpd, Nginx, ruTorrent, and autodl-irssi


To simplify installation, were going to use an open source script. (https://github.com/arakasi72/rtinst)
wget --no-check-certificate https://raw.githubusercontent.com/arakasi72/rtinst/master/rtinst.sh
sudo bash rtinst.sh -t

Create a new user to run rTorrent under. You dont want to use your current user, as it has root privileges.
Follow the guided installation to completion and you should have your webserver and torrent client installed.
Be sure to restart the server after completing installation (the script will prompt you).
The script automatically set some useful aliases for restarting rTorrent, adding ruTorrent users, etc. For a list of
these, visit the GitHub page linked above.

3
Ace @ HDTS
Nov 10 2016

Installing Plex Media Server


Though the below command will install the current (as of this guide), I would suggest acquiring the latest url
from https://plex.tv/.
wget https://downloads.plex.tv/plex-media-server/1.2.7.2987-1bef33a/plexmediaserver_1.2.7.2987-
1bef33a_amd64.deb

sudo dpkg -i plexmediaserver_1.2.7.2987-1bef33a_amd64.deb

Once your server is installed, you will need to connect to the web panel via localhost. The easiest way to do
this is to SSH tunnel through putty. Load your servers profile in putty, and navigate to the Connection > SSH >
Tunnels page. Enter the following information and click Add.

You will then need to go back to the Session tab and save your servers profile. When you connect to the
terminal, you will now be tunneled through the server.
You can now connect to the Plex Media Server by navigating your browser to http://127.0.0.1:32400/web/.
Tunneling is only required for the initial configuration of the server. From then on, youll connect via a custom
URL that will be explained in the next step.

4
Ace @ HDTS
Nov 10 2016

Installing Sonarr
Sonarr is packaged under their own repository, so you will need to add it to your apt sources to install it.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC
echo "deb http://apt.sonarr.tv/ master main" | sudo tee /etc/apt/sources.list.d/sonarr.list
sudo apt-get update && sudo apt-get install mono-devel mono-complete nzbdrone

In order to make Sonarr start on boot, youll need to add a startup script. Follow the instructions here:
https://github.com/Sonarr/Sonarr/wiki/Autostart-on-Debian
Sonarr will need minimal configuring to link to both Plex and rTorrent.
Under settings > download client, add a new client and select rTorrent. You will be prompted to add the
following information:

Test the configuration to ensure its working, and then save it.

5
Ace @ HDTS
Nov 10 2016

Under settings > connect, add a new connection and select Plex Media Server. You will be prompted to enter
the following information:

Under settings > general, youll want to set the URL Base to:
/sonarr

Leave the SSL and port settings alone. It is very tricky to make SSL work with Sonarr, so a solution is to use
your domain as a reverse proxy (which will also give you user friendly URLs). The URL Base change is in
preparation for the reverse proxy.
You can connect to your desired indexer. Currently Sonarr is not supported on HDTS, but this guide may
prompt the indexer implementation.

6
Ace @ HDTS
Nov 10 2016

Setting up Nginx Reverse Proxy


By adding a reverse proxy, we can take ugly Web Service URLs and convert them into clean, easy to remember
URLs. This also acts as our SSL connection to Sonarr. In order to do this, we need to edit our Nginx server.
Replace/edit the contents of /etc/nginx/sites-enabled/default to match the following (replacing the
server_name with your domain in both virtual servers):
http://cryptb.in/Xham#7fbae365906d2017f94ce1b80d418984
http://hastebin.com/awocanibub.nginx
http://pastebin.com/tLRqURmq
(Script has been posted multiple times for redundancy)

Restart Nginx:
sudo service nginx restart

7
Ace @ HDTS
Nov 10 2016

Generating and Installing a LetsEncrypt SSL Certificate


While the rtorrent script has automatically generated a SSL certificate for Nginx, we would prefer it to be a
trusted certificate. Certbot is a certificate generator that deploys LetsEncrypt SSL certificates. Since Certbot is
packaged for debian in the Jessie backports, we wont need to compile it from source.
(https://certbot.eff.org/#debianjessie-nginx)
In order to install Certbot, well need to add backports to the apt repository.
echo "deb http://ftp.debian.org/debian jessie-backports main" | sudo tee /etc/apt/sources.list.d/jessie-backports.list

Now install Certbot:


sudo apt-get update && sudo apt-get install certbot -t jessie-backports

Run Certbot with the below command. You will want to specify the webroot plugin (webroot is /var/www/)
and your domain/sub-domain that you wish to use.
sudo certbot certonly

Once you generate your certificates, youll need use them to replace the certificates generated by the script.
sudo cp /etc/letsencrypt/keys/0000_key-certbot.pem /etc/ssl/ruweb.key

sudo cp /etc/letsencrypt/csr/0000_csr-certbot.pem /etc/ssl/ruweb.crt

Restart Nginx:
sudo service nginx restart

Potrebbero piacerti anche