Install SABnzbd, Sonarr, CouchPotato, and Headphones on CentOS 7

This post was last updated on Mar 21, 2017. GPG key added for Sonarr, SABnzbd repo removed (added direct links for unrar and python-yenc packages), and install for Radarr was added.

This post is for installing the automation applications for Usenet downloading on CentOS 7. In my previous guides written for CentOS 6, I was using SABnzbd, SickBeard, CouchPotatoServer, and Headphones. This time around, I am using the same applications, except that I am switching from SickBeard to Sonarr. Why? Well, development has slowed way down for SickBeard since the main dev has called it quits. SickBeard has always worked well for me, I tried SickRage for a while, and but once I really tested Sonarr it was an obvious choice.

With this guide, I'm creating a service account named usenet, which all of these services will be running as. In my setup, firewalld is disabled (systemctl disable firewalld.service && systemctl stop firewalld.service), and I have SELinux disabled (sed -i /etc/selinux/config -r -e 's/^SELINUX=.*/SELINUX=disabled/g'). If you disable firewalld and selinux, you do so at your own risk. It is not advisable to do either if your usenet downloader is directly accessible on the internet, so please use a reverse proxy or something similar! I have a very simple guide available for a Nginx Reverse Proxy build that can be found HERE.

Let's Get Started!

1.) prerequisites:
useradd -r usenet   # Create usenet service account
yum -y install epel-release   # Install EPEL repo

yum -y install wget git par2cmdline p7zip unzip tar gcc python-feedparser python-configobj python-cheetah python-dbus python-devel   # Install Prereqs
yum -y install ftp://rpmfind.net/linux/dag/redhat/el7/en/x86_64/dag/RPMS/unrar-5.0.3-1.el7.rf.x86_64.rpm   # Install unrar
yum -y install ftp://rpmfind.net/linux/fedora/linux/releases/22/Everything/x86_64/os/Packages/p/python-yenc-0.4.0-4.fc22.x86_64.rpm   # Install python-yenc
yum -y update && reboot

Prereqs done; now lets install SAB!

2.) sabnzbd install:
mkdir -p /apps/data/.sabnzbd && cd /apps   # Create data dir for SABnzbd
git clone -b master https://github.com/sabnzbd/sabnzbd.git sabnzbd   # Download SABnzbd files
chown -R usenet:usenet /apps   # Change ownership of SABnzbd files
vi /etc/systemd/system/sabnzbd.service   # Create systemd service script file
---
#
# Systemd unit file for SABnzbd
#

[Unit]
Description=SABnzbd Daemon

[Service]
Type=forking
User=usenet
Group=usenet
ExecStart=/usr/bin/python /apps/sabnzbd/SABnzbd.py --daemon --config-file=/apps/data/.sabnzbd/sabnzbd_config.ini -s 0.0.0.0
GuessMainPID=no

[Install]
WantedBy=multi-user.target
---

systemctl enable sabnzbd.service   # Set SABnzbd to start at system boot

SABnzbd is now installed, and set to run at boot. SABnzbd is not currently running, but will start running on port 8080 as the service is started (or system rebooted).

3.) sonarr install:
vi /etc/yum.repos.d/mono.repo   # Create mono repo
---
[mono]
name=mono for Centos 7 - Base
baseurl=http://download.mono-project.com/repo/centos/
failovermethod=priority
enabled=1
gpgcheck=0
---

rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"   # GPG key for mono repo
yum -y install mediainfo libzen libmediainfo curl gettext mono-core mono-devel sqlite   # Additional pre-reqs for Sonarr
mkdir -p /apps/{data/.sonarr,sonarr} && cd /apps   # Create data dir for Sonarr
wget http://download.sonarr.tv/v2/master/mono/NzbDrone.master.tar.gz   # Download Sonarr files
tar -xvf NzbDrone.master.tar.gz   # Extract Sonarr (NzbDrone) files
mv NzbDrone/* sonarr/. && rm -rf NzbDrone*   # Move to sonarr folder, and cleanup after the download
chown -R usenet:usenet /apps   # Change ownership of Sonarr files
vi /etc/systemd/system/sonarr.service   # Create systemd service script file
---
#
# Systemd unit file for Sonarr
#

[Unit]
Description=Sonarr Daemon

[Service]
Type=simple
User=usenet
Group=usenet
ExecStart=/usr/bin/mono /apps/sonarr/NzbDrone.exe /data=/apps/data/.sonarr
Restart=always
RestartSec=15
TimeoutStopSec=20

[Install]
WantedBy=multi-user.target
---

ln -s /usr/lib64/libMonoPosixHelper.so /usr/lib/libMonoPosixHelper.so
systemctl enable sonarr.service   # Set Sonarr to start at system boot

Sonarr is now installed, and set to run at boot. Sonarr is not currently running, but will start running on port 8989 as the service is started (or systemctl rebooted).

4.) couchpotatoserver install:
yum -y install libxslt-devel && easy_install lxml   # Install lxml
yum -y install http://mirror.centos.org/centos/7/cloud/x86_64/openstack-liberty/common/pyOpenSSL-0.15.1-1.el7.noarch.rpm   # Install pyOpenSSL
mkdir -p /apps/data/.couchpotatoserver && cd /apps   # Create data dir for CouchPotatoServer
git clone https://github.com/RuudBurger/CouchPotatoServer.git couchpotatoserver   # Download CouchPotatoServer files
chown -R usenet:usenet /apps   # Change ownership of CouchPotatoServer files
vi /etc/systemd/system/couchpotatoserver.service   # Create systemd service script file
---
#
# Systemd unit file for CouchPotatoServer
#

[Unit]
Description=CouchPotatoServer Daemon

[Service]
Type=forking
User=usenet
Group=usenet
ExecStart=/usr/bin/python /apps/couchpotatoserver/CouchPotato.py --daemon --data_dir=/apps/data/.couchpotatoserver --config_file=/apps/data/.couchpotatoserver/couchpotatoserver_config.ini --quiet
GuessMainPID=no

[Install]
WantedBy=multi-user.target
---

systemctl enable couchpotatoserver.service   # Set CouchPotatoServer to start at system boot

CouchPotatoServer is now installed, and set to run at boot. CouchPotatoServer is not currently running, but will start running on port 5050 as the service is started (or system rebooted).

5.) headphones install:
mkdir -p /apps/data/.headphones && cd /apps   # Create data dir for Headphones
git clone https://github.com/rembo10/headphones.git headphones   # Download Headphones files
chown -R usenet:usenet /apps   # Change ownership of Headphones files
vi /etc/systemd/system/headphones.service   # Create systemd service script file
---
#
# Systemd unit file for Headphones
#

[Unit]
Description=Headphones Daemon

[Service]
Type=forking
User=usenet
Group=usenet
ExecStart=/usr/bin/python /apps/headphones/Headphones.py --daemon --datadir=/apps/data/.headphones --config=/apps/data/.headphones/headphones_config.ini --quiet --nolaunch
GuessMainPID=no

[Install]
WantedBy=multi-user.target
---

systemctl enable headphones.service   # Set Headphones to start at system boot

Headphones is now installed, and set to run at boot. Headphones is not currently running, but will start running on port 8181 as the service is started (or system rebooted).

6.) radarr install:

Recently there was a new project that has come to light. It's called Radarr, and is a fork of Sonarr but to deal with movies. Essentially it is a replacement for CouchPotatoServer. I have high hopes for this project and expect to replace CouchPotatoServer with it in the future. The install is very similar to Sonarr, so as long as you've installed Sonarr already, you'll have most of the pre-reqs. At this time, we will be installing the Develop branch.

Radarr and CouchPotatoServer can be installed side-by-side, but in reality you should only be using one of the two.

yum -y install mono-locale-extras   # Necessary for Radarr  
mkdir -p /apps/{data/.radarr,radarr} && cd /apps   # Create data dir for Radarr
wget https://github.com/Radarr/Radarr/releases/download/v0.2.0.267/Radarr.develop.0.2.0.267.linux.tar.gz   # Download Radarr files
tar -xvf Radarr.develop.0.2.0.267.linux.tar.gz   # Extract Radarr files
mv Radarr/* radarr/. && rm -rf Radar*   # Move to radarr folder, and cleanup after the download
chown -R usenet:usenet /apps   # Change ownership of Radarr files
vi /etc/systemd/system/radarr.service   # Create systemd service script file
---
[Unit]
Description=Radarr Daemon

[Service]
Type=simple
User=usenet
Group=usenet
ExecStart=/usr/bin/mono /apps/radarr/Radarr.exe /data=/apps/data/.radarr
Restart=always
RestartSec=15
TimeoutStopSec=20

[Install]
WantedBy=multi-user.target
---

systemctl enable radarr.service   # Set Sonarr to start at system boot
7.) finish:

All that's left is a reboot!

systemctl reboot

Once your server boots, you'll have SABnzbd, Sonarr, CouchPotatoServer, and Headphones running at their designated ports (listed above). Go forth, configure, and download!

If you're having trouble accessing any of the webpages for these apps, make sure you have configured firewalld to allow access to the designated ports, or simply disable firewalld. In my setup, I have firewalld disabled, and use Nginx as a reverse proxy to access these services from the internet.

Leave me some feedback!


Related Posts


Share on: Twitter | Facebook | Google+ | Email


comments powered by Disqus