Obfuscates
Systems

Streaming Media Server | Part 2 | Building the Test System

In the first part we did all the research to find the components used to create this solution. This post will cover the first part of building a system, the installation of components. The next post will dig more into the configuration of each component. The decision to break it out into two posts is due to the length of information collected. One post would be very long in comparison.

Quick Overview:

In review, the components we selected are listed below. The only change to the list from the previous post is that Couch Potato was replaced by Radarr. This was a result of the complex install process behind Couch Potato. The hope was to make this install as simple as possible, and Radarr was a bit simpler than Couch Potato.

Also, this install will be completed on one Virtual Machine using VMware Workstation 16 player. Since there is no guarantee everything will work as we plan, it’s best to test what you can without purchasing hardware. Once the test system is online and validated, metrics can be captured and capacity planning can be done to ensure future purchases will exceed the need of the system. With that, here is the update list of software.

Software used:

  • Unbuntu Server 20.04.1 | Server Software
  • SABnzbd | Downloader & Moving Files
  • Sonnarr | PVR
  • Radarr | PVR
  • Plex | Media Player Client

Install Ubuntu:

The installation of Ubuntu was very straight forward. Since this is a Virtual Machine (VM), there was no need to cut the ISO to bootable media. The VM created has 4 vCPU’s and 16GB memory allocated. The primary drive is configured as 100Gb and is thin provisioned. The drive is not cut into partitions or separate volumes. It’s all slapped together on one drive and will suffice for testing purposes.

During the install, the only major thing suggested is to install a server w/o GUI. The GUI take additional overhead we don’t need with a linux server. Assumable, the network has a DHCP server, if not an IP will have to be statically configured. No other requirements will identified, and proceed with the server install on the VM.

System Updates:

Once the install of the OS is done, update the system. This is crucial to a new system. Yes, during the install the installer may have pulled most recent files from the internet. However, go ahead and run updates just to validate. If it pulled the most recent, there will be nothing to do. My preference is to be safe, not sorry. To check for updates:

sudo apt update
sudo apt upgrade -y

The first command will look to see if updates are available. The second command will install those updates on the system. There’s a chance it may take a while, but it’s worth the wait. In very rare cases is it not wise to update immediately, but in about 99.99% of cases, it makes sense.

SABnzbd

SABnzbd (SAB) is a downloader used to pull media from where it’s told. All the information it needs to pull the media is in nzb files written to a directory watched by SAB. SAB checks this directory every 5 to 15 seconds for new files. If a new file appears, it will read the file and attempt to download the media from the location specified. The media will be downloaded to a temporary directory, smooshed together into one file, and moved to it’s final resting place. It may sound fairly simple, but that’s because SAB does an excellent job at it.

The source of sabnzbd.org was used to complete the install. However, below is the process I used.

# Add SAB repo to server 
sudo add-apt-repository ppa:jcfp/nobetas

# Update all components previous to the install
sudo apt-get update && sudo apt-get dist-upgrade

# Complete the upgrades
sudo apt upgrade -y

# Initiate the install of Sabznbd
sudo apt install sabnzbdplus

# Create a user to use for all media streaming actions
sudo adduser mediastream

# Create a service to run in the background by first editing the file at:
/etc/default/sabnzbdplus

# Find the below lines in the config file to match your setup:
USER=mediastream
HOST=<hostIpAddress>
PORT=<portToUse>

# Reload the services daemon 
systemctl daemon-reload

# Enable and start the service
systemctl enable --now sabnzbdplus

# Navigate to the webGUI that starts with SABnzbd
http://<hostIpAddress:portToUse>

When visiting the ip address and port specified, the SABnzbd web GUI should be available, and a configuration / setting pages should be shown. Hold here, other components need to be installed. We will come back to this in the next post.

Install Sonarr

Sonarr is the component used to find media on usenets. You don’t have to use Sonarr, but it works well and serves the purpose. The source used for installation is Sonar Downloads. Below is the process used for the test system.

# Register the keystores from sonar with your server. 
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 2009837CBFFD68F45BC180471F4F90DE2A9B4BF8

# Add the repo to your sources:
echo "deb https://apt.sonarr.tv/debian jessie main" | sudo tee /etc/apt/sources.list.d/sonarr.list

# Update all the packages with the new repo added.
sudp apt install sonarr

# Accept the user and group specified during the install, both should be sonarr

# The Sonarr web GUI should not be available on the port / IP of your server. 
https:<ipToServer>:8989

Couch Potato

Initially, the intent was to install and use couch potato. However, after reading the install instructions it felt like it would be far to much work to get it working. Radarr wasn’t much better, but the process was easier to follow and would be easier for less experienced people to execute. If you are interested and want to make your own decision, you can view their site HERE.

Radarr

The Radarr install is a bit complicated. However, if care is taken, the install is pretty straight forward and easy. Here is the source of the install process: Radarr Install Process. Below is the process as I followed it.

# Install curl and sqlite3, If they are already installed, it won't overwrite them. 
sudo apt install curl sqlite3 

# create a radarr user and group, and add the user to the group
sudo useradd radarr
sudo groupadd media 
sudo usermod -aG media radarr
sudo usermod -aG media mediastream 

# Create and update the permissions to the correct directory 
mkdir /var/lib/radarr
chown -R media:sonarr /var/lib/radarr

# Move to the downloads directory 
cd ~/Downloads

# Download the correct binary for your system, the test system is x86 64bit which results in amd64
wget --content-disposition 'http://radarr.servarr.com/v1/update/master/updatefile?os=linux&runtime=netcore&arch=x64'

# Make sure everything you download is in the download directory
ls -lach ~/Downloads

# Expand the tarball, move it to /opt, and update permissions so the previous user and group can control it.
tar zxvf Radar*.linux*.tar.gz 
sudo mv Radarr /opt/
sudo chown -R radarr:media /opt/Radarr

# Create the svc file and change any configs needed for your install
cat << EOF | sudo tee /etc/systemd/system/radarr.service > /dev/null
[Unit]
Description=Radarr Daemon
After=syslog.target network.target
[Service]
User=radarr
Group=media
Type=simple

ExecStart=/opt/Radarr/Radarr -nobrowser -data=/var/lib/radarr/
TimeoutStopSec=20
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF

# reload the services daemon, enable/start the service, and check status 
systemctl daemon-reload 
systemctl enable --now radarr 
systemctl status radarr 

# Assuming the service status indicates it's running, visit the webGUI
http://<hostIpAddress>:7878

At this point the webGUI for Radarr should be accessible. Again, no configurations yet. That is the next post.

Plex Media Server

The plex media server is what hosts the media and allows access from multiple devices. It’s been my go too solution for a while. Most media sticks / systems have Plex as an app so using plex on most systems is plausible. The install, compared to Radarr, is simple and can be found at the following source: Install Plex Media Server

# Add the repo and download the GPG keys
echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -

# Update repo's now that the repo's are added, install plex.
sudo apt update
sudo apt install plexmediaserver

# Start the Plex Media Server service 
sudo systemctl enable --now plexmediaserver

# Check the Plex Media Server Service to ensure it's running
sudo systemctl status plexmediaserver

#Navigate to the URL on the server to access the webGUI 
http://<yourIpAddress>:32400/web

Yep, must less effort for Plex then other components. With this done, we’ll close out this post and the next will look at configurations.

Review

In this post we complete the install of the following components which are accessible at their specific ports.

  • SABnzbd | http://<hostIpAddress:portToUse>
  • Sonarr  | https:<ipToServer>:8989
  • Radarr  | http://<hostIpAddress>:7878
  • Plex    | http://<yourIpAddress>:32400/web