In this guide we will install Plex and configure ruTorrent to save all the downloads to a a separate HDD on the system called ‘plex-media’. We will also set up Apache so that you can reach your torrent client from wherever you are in the world. To follow this guide you must first follow this guide.

Let’s begin!

  1. Download Plex

    Get the latest packages from here. Copy the link and paste in in your SSH terminal. Alternatively you can download the file and transfer it with Webmin or similar.

    $~: sudo wget https://downloads.plex.tv/plex-media-server/1.3.4.3285-b46e0ea/plexmediaserver_1.3.4.3285-b46e0ea_amd64.deb
  2. Install Plex
    $~: sudo dpkg -i plexmediaserver_1.3.4.3285-b46e0ea_amd64.deb
  3. Extend your disk or add another one

    We use VMware ESXi, and in this guide we will add another hard drive to the VM and mount it as a second drive. If you want to extend your current HDD we wrote a guide that you can find here. This HDD will act as the drive that we will place all the downloads on from the torrent client and that Plex will get its media from.

    1. BOOT Ubuntu Server

      Log in as the user ‘plex’ and then become root

      :~$ sudo -i
    2. SCAN THE NEW DISK SPACE
      :~$ echo "- - -" > /sys/class/scsi_host/host0/scan
    3. USE CFDISK TO MAKE A NEW PARTITION
      :~$ cfdisk /dev/sdb
    4. CREATE NEW PARTITION

      [New]

      Partition size: XX TB

      Just press enter to select the whole disk

    5. WRITE CHANGES TO DISK

      [Write]

      Are you sure you want to write the partition table to disk? (yes or no): yes
    6. QUIT CFDISK

      [Quit]

    7. RESCAN THE PARTITIONS
      :~$ partprobe -s
    8. CHECK THE NEWLY CREATED PARTITION
      :~$ fdisk -l

      Likley it appears as /dev/sdb1

    9. FORMAT THE PARTITION

      Use the partition you identified in the previous step and type

      :~$ mkfs.ext4 /dev/sdb1
  4. Mount the new drive

    After you are done creating your partitions (most likely it will be just one ext4 data partition, since this is your additional storage drive), you need to permanently mount it. At this step you already know what names your new partition(-s) have. If not sure, following command will remind you about existing drives and partitions on them:

    $~: sudo blkid
    

    This will output something like this

    /dev/sdb1: UUID="33bcb61a-8c12-40af-a66d-1f7e8961fc9b" TYPE="ext4" PARTUUID="bdaa1ea8-2d77-49d9-9291-c023e3650e53"
    
    /dev/sr0: UUID="2016-04-20-22-45-29-00" LABEL="Ubuntu-Server 16.04 LTS amd64" TYPE="iso9660" PTUUID="4cbe268b" PTTYPE="dos"
    /dev/sdb1: UUID="dd871db1-db52-483f-b520-d3596a84eb27" TYPE="ext2" PARTUUID="7a3d972f-01"
    /dev/sdb5: UUID="Q8BAPY-6P9i-N4x7-yYEM-0U0V-UD14-unBW9Y" TYPE="LVM2_member" PARTUUID="7a3d972f-05"
    /dev/mapper/Plex--vg-root: UUID="a5149a2f-b417-4434-a2a7-71c3eb7fd391" TYPE="ext4"
    /dev/mapper/Plex--vg-swap_1: UUID="e2fceb9b-13f8-4d22-8e01-f492d85cc271" TYPE="swap"
    

    Output states, that your new partition is /dev/sda1. Now you need to mount it to utilize it’s precious space. To achieve this, you need to perform three simple steps:

  5. Create a mount point
    $~: sudo mkdir /media/plex-media
    
  6. Add mountpoint in /etc/fstab

    Open /etc/fstab file with root permissions:

    $~: sudo nano /etc/fstab
    

    And add following to the end of the file:

    UUID=33bcb61a-8c12-40af-a66d-1f7e8961fc9b /media/plex-media          ext4    defaults 0       1

    Change the blkid to your drive

  7. Mount partition
    $~: mount /media/plex-media
  8. Create new dirs for Plex
    $~: sudo mkdir /media/plex-media/Downloads/incomplete
    $~: sudo mkdir /media/plex-media/Downloads/complete

    You can create as many dirs your want here, but in this guide we will only use the these two. Make sure to set correct permissions:

    $~: sudo chown -R plex:plex /media/plex-media/Downloads/
  9. Continue the installation of Plex in Web GUI

    Simply just go to

    http://192.168.8.100:32400/web/index.html

    Follow the instructions and setup your folders where Plex should look for files. If you, like us, had issues with that Plex couln’t install the server via the Web GUI, then follow this guide and install via a browser in Ubuntu Desktop.

  10. Allow remote access to ruTorrent with Apache

    To be able to reach your ruTorrent outside your LAN or private network you have to open ports (the one you want to configure) in your router and also set up a Virtual Host in Apache. This is a pretty straight forward process, here is a simple config:

    <VirtualHost *:80>    
    
    ServerName www.example.com    
    ServerAdmin [email protected]   
    DocumentRoot /var/www/html/ruTorrent    
    
    ErrorLog ${APACHE_LOG_DIR}/error.log    
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    CustomLog /var/log/apache2/rutorrent.log vhost_combined
    
    ErrorLog /var/log/apache2/rutorrent_error.log    
    
    </VirtualHost>

    Please notice that anyone will have access to your ruTorrent with this setup. If you want to secure your setup, please follow this guide.

  11. And we’re all set!

    Please let us know if you find any typos or errors. Have fun!