Ubuntu: How To Setup SickRage for Automatic TV Show Downloading

How To Setup SickRage for Automatic TV Show Downloading… 

Step 1: Install Ubuntu Mate 16.10

  • Download the Ubuntu minimal-iso through https://help.ubuntu.com/community/Installation/MinimalCD
  • Create a generation 2 Hyper-V virtual machine. Specs: 1 CPU, 1GB of memory, 2 hard disks (one for the OS, one for the video files)
  • Install the OS, choose these packages to install: standard system utilities, Ubuntu Mate minimal installation, basic Ubuntu server
  • Choose to create a separate user, do NOT use the root account
  • (Optional:) when manually partitioning, create 3 partions on the first (OS) disk: 1 EFI partition, 1 swap partition, 1 EXT4 root-partition

Step 2: Configuring Ubuntu Mate

  • Enable firewall-gui:
    sudo apt-get gufw
  • Enable boot messages during booting by editing /etc/default/grub:
    sudo nano /etc/default/grub
  • Edit the line starting with GRUB_CMDLINE_LINUX_DEFAULT: remove splash, quiet
  • Add “video=hyperv_fb:1024×600” to set virtual machine resolution to 1024×600
  • To process the changes made, run the following command:
    sudo update-grub
  • Setup automatic login:
    sudo mkdir /etc/lightdm/lightdm.conf.d
    sudo nano /etc/lightdm/lightdm.conf.d/50-myconfig.conf
  • Add the following to the file:
  • Configure a fixed ip address
    sudo nano /etc/network/interfaces
  • Add the following to the file (example):
    auto lo eth0
    iface lo inet loopback
    iface eth0 inet static
  • Install updates for Ubuntu:
    sudo apt-get update
    sudo apt-get dist-upgrade
    sudo apt-get upgrade
    sudo apt-get install unrar

Step 3: Configure Ubuntu as a ‘NAS’

  • Install gnome-disk-utility to format the 2nd drive that will hold the tvshow-files:
    sudo apt-get install gnome-disk-utility
  • Format the 2nd drive using the EXT4 file system
  • Configure Ubuntu to mount the drive on boot. For this, we need to know the UUID of the drive. To display this information, type the following command and copy the UUID:
    sudo blkid
  • The UUID needs to be added to the file that controls mounting at boot. Enter the following command to open that file:
    sudo nano /etc/fstab
  • Add the following line to the file, replacing <UUID> by the UUID displayed by the blkid command:
    <UUID> /media/NAS ext4 defaults 1 2
  • Install Samba to share files to Windows systems:
    sudo apt-get install samba
    sudo apt-get install system-config-samba
    sudo touch /etc/libuser.conf
    sudo smbpasswd -a username
  • Create folders on the second drive, named Series, TempFolder, TempFolderIncomplete
  • Create shares by using the Samba Configuration GUI:
    sudo system-config-samba
  • Share the created folders, permissions: writable, visable, only for username user
  • Install NFS to share the folders to other Linux clients:
    sudo apt-get install nfs-kernel-server
  • To create NFS-shares, edit the exports-file:
    sudo nano /etc/exports
  • Add the following lines:
    /media/NAS/Series *(rw,sync,no_root_squash,insecure)
    /media/NAS/TempFolder *(rw,sync,no_root_squash,insecure)
    /media/NAS/TempFolderIncomplete *(rw,sync,no_root_squash,insecure)

Step 4: Install and configure Deluge Torrent Client

  • Install Deluge by typing these commands:
    sudo add-apt-repository ppa:deluge-team/ppa
    sudo apt-get update && sudo apt-get install deluge deluged
  • Configure Deluge to use the following settings:
  • In the settings (preferences), click interface and disable classic mode.
  • Shutdown and restart Deluge. Remove the suggested configuration. Add a new configuration and use localhost, port 8082. Leave the username and password box empty. Start the daemon. Enable all three check marks. Click connect.
  • Return to the settings. In the downloads tab, download to should be configured as /media/NAS/TempFolderIncomplete and move completed to should be configured as /media/NAS/TempFolder.
  • In the network tab, the encryption level should be full stream.
  • Optional: install the AutoRemovePlus plugin. Go to http://www.cuttingcords.com/home/2015/2/4/auto-deleting-finished-torrents-from-deluge.
  • Configure AutoRemovePlus: Check every: 0,010. Maximum torrents: 0. Seed time: 0,009. Data added: 0.
  • Configure Ubuntu to start Deluge automatically upon boot. Go to system > preferences > personal > startup applications. Click add, type Deluge in the ‘name’ box and type the following in the ‘command box: bash –c “sleep 60 && /usr/bin/deluge”

Step 5: Install and configure SickRage:

  • Install SickRage:
    sudo apt-get install git-core python python-cheetah
    cd ~
    git clone https://github.com/SickRage/SickRage.git .SickRage
  • Configure SickRage:
  • Configure Ubuntu to start Deluge automatically upon boot. Go to system > preferences > personal > startup applications. Click add, type Sickrage in the ‘name‘ box and type the following in the ‘command‘ box: bash -c “sleep 120 && /usr/bin/python /home/username/.SickRage/SickBeard.py -q –daemon –nolaunch –datadir=/home/username/.SickRage”
  • Reboot Ubuntu
  • Browse to and enter the settings
  • Tab general/misc: disable open the sickrage home page at startup. Add /media/NAS/Series to the Show root directories
  • Tab general/interface: create a username and password
  • Tab general/advanced: enable debug logging
  • Tab search settings/episode search: enable Randomize Providers. Change check propers to every 4 hours. Disable Allow high priority
  • Tab search settings/torrent search: pick deluge (via daemon), localhost:8082
  • Tab search providers/provider priorities: pick TPB, Rarbg
  • Tab search providers/provider options: enable fallback for all providers. Set minimum seeders to 5 for all providers
  • Tab subtitle settings/subtitles search: enable search subtitles. Add English. Enable subtitle history
  • Tab subtitles settings/subtitles plugin: enable addic7ed, opensubtitles and podnapisi
  • Tab subtitles settings/plugin settings: enter username and password for addic7ed and opensubtitles
  • Tab post processing/post-processing: enable post processing. Enter /media/NAS/TempFolder as the post processing directory. processing method: move. Disable postpone post processing uit. Disable rename episodes. Enable delete associated files. Enable unpack. Enable delete rar contents.

Step 6: Install and configure TorGuard

  • To use TorGuard-vpn, register at torguard.net and pay for their monthly vpn plan (for example)
  • After registration and payment, log in and download the TorGuard app for Ubuntu, 64-bit
  • Start the application, choose a country and enable autoconnect at startup. Enter your credentials
  • The TorGuard-application requires root permissions. Since we are going to enable the application to startup at boot, we need to allow the TorGuard application to get root permissions without manually entering root credentials everytime we reboot Ubuntu. To do so, enter the following command to create a file:
    nano autosudofortorguard
  • Now we need to know the system hostname. This was chosen during the installation of Ubuntu. If you do not remember, enter the following command:
  • In autosudofortorguard, add the following lines:

Cmnd_Alias TORGUARD=/opt/torguard/bin/torguard

  • For this to work, autosudofortorguard needs to be put in the right place and needs the right permissions. Enter these commands:
    sudo chown root:root autosudofortorguard
    sudo chmod 0440 autosudofortorguard
    sudo mv autosudofortorguard /etc/sudoers.d
  • To check whether everything went fine, enter:
    sudo -l
  • Now, just like we did with Deluge and SickRage, add TorGuard to the startup applications: Go to system > preferences > personal > startup applications. Click add, type Sickrage in the ‘name‘ box and type the following in the ‘command‘ box: bash -c “sleep 5 && sudo /opt/torguard/bin/torguard”

Step 7: Configure the firewall

  • To make sure no torrents are always downloaded through the tunnel, we have to configure the firewall. This means that whenever the connection to TorGuard gets cut off, all internet connections cease.
  • Install the firewall GUI:
    sudo apt-get install gufw python-gi
  • Now configure the firewall by entering the following commands:
  • Allow traffic through the tunnel:
    sudo ufw allow in on tun0 from any to any
    sudo ufw allow out on tun0 from any to any
  • Allow traffic to the LAN:
    sudo ufw allow out to
    sudo ufw allow in from
  • Allow connecting to the TorGuard VPN service:
    sudo ufw allow out from any to any port 443 proto udp
    sudo ufw allow out from any to any port 53
    sudo ufw allow out from any to any port 389 proto udp
  • Block all other traffic when TorGuard is not connected:
    sudo ufw default deny incoming
    sudo ufw default deny outgoing
  • Enable the firewall:
    sudo ufw enable
  • The rules can be checked through the firewall GUI