Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ubuntu Server plexbox setup

Start with a fresh Ubuntu Server 16.04 installation. NOTE: In the commands and files below, be sure to replace <yourusername> with your username and <yourgroupname> with your group name (probably the same as your username). Also, replace <yourhostname> with your server's hostname.

Install Dependencies:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/mono-official.list
sudo apt update
  • Install Mono and some associated tools:
sudo apt install mono-devel mediainfo sqlite3 libmono-cil-dev curl ca-certificates-mono libcurl4-openssl-dev -y

Install Deluge (BitTorrent Daemon):

sudo add-apt-repository ppa:deluge-team/ppa
sudo apt update
sudo apt install deluged deluge-web deluge-console -y
  • Set up a service user for the deluge daemon, and add yourself to its group:
sudo adduser --system  --gecos "Deluge Service" --disabled-password --group --home /var/lib/deluge deluge
sudo adduser <yourusername> deluge
  • Create and enable the deluged.service file at /etc/systemd/system/deluged.service (contents at bottom of gist)
sudo systemctl enable /etc/systemd/system/deluged.service
sudo service deluged start
sudo service deluged status
  • Create and enable the deluge-web.service file at /etc/systemd/system/deluge-web.service (contents at bottom of gist)
sudo systemctl enable /etc/systemd/system/deluge-web.service
sudo service deluge-web start
sudo service deluge-web status
  • View Deluge Web UI at http://<yourhostname>:8112
  • The default deluge-web password is just "deluge". Change this in your first login.
  • In Deluge preferences, go to Plugins and enable the Labels plugin (required by Sonarr/Radarr)

Install Jackett (Index Provider for Sonarr and Radarr):

cd /tmp
wget https://github.com/Jackett/Jackett/releases/download/v0.8.321/Jackett.Binaries.Mono.tar.gz
sudo tar -xf Jackett* -C /opt/
sudo chown -R <yourusername>:<yourgroupname> /opt/Jackett
mono --debug /opt/Jackett/JackettConsole.exe
  • CTRL+C out of the test run.
  • Create and enable the jackett.service file at /etc/systemd/system/jackett.service (contents at bottom of gist)
sudo systemctl enable /etc/systemd/system/jackett.service
sudo service jackett start
sudo service jackett status
  • View Jackett at http://<yourhostname>:9117/UI/Dashboard
  • NOTE: Jackett's UI is unsecured by default, scroll down and set an admin password before you do anything else.
  • Add a bunch of public indexers, and leave the tab open for use to configure Sonarr/Radarr

Install Sonarr (TV Show Downloader):

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC
sudo echo "deb http://apt.sonarr.tv/ master main" | sudo tee /etc/apt/sources.list.d/sonarr.list
sudo apt update
sudo apt install nzbdrone -y
mono --debug /opt/NzbDrone/NzbDrone.exe
  • CTRL+C out of the test run.
  • Create and enable the sonarr.service file at /etc/systemd/system/sonarr.service (contents at bottom of gist)
sudo systemctl enable /etc/systemd/system/sonarr.service
sudo service sonarr start
sudo service sonarr status
  • View Sonarr at http://<yourhostname>:8989
  • NOTE: Sonarr's UI is unsecured by default, be sure to go to Settings -> General -> Security and add a password.
  • In Settings -> Download Client, add Deluge. Use default host and port, and the deluge-web password you set.
  • In Settings -> Indexers, add indexers with the Torznab -> Custom option, using the Torznab URLs and API key from Jackett.
  • Add TV Series or import existing media.

Install Radarr (Movie Downloader):

cd /tmp
wget https://github.com/Radarr/Radarr/releases/download/v0.2.0.870/Radarr.develop.0.2.0.870.linux.tar.gz
sudo tar -xf Radarr* -C /opt/
sudo chown -R <yourusername>:<yourgroupname> /opt/Radarr
mono --debug /opt/Radarr/Radarr.exe
  • CTRL+C out of the test run.
  • Create and enable the radarr.service file at /etc/systemd/system/radarr.service (contents at bottom of gist)
sudo systemctl enable /etc/systemd/system/radarr.service
sudo service radarr start
sudo service radarr status
  • View Radarr at http://<yourhostname>:7878
  • NOTE: Radarr's UI is unsecured by default, be sure to go to Settings -> General -> Security and add a password.
  • In Settings -> Download Client, add Deluge. Use default host and port, and the deluge-web password you set.
  • In Settings -> Indexers, add indexers with the Torznab -> Custom option, using the Torznab URLs and API key from Jackett.
  • Add Movies or import existing media.

Install Plex Media Server:

cd /tmp
wget https://downloads.plex.tv/plex-media-server/1.9.4.4325-1bf240a65/plexmediaserver_1.9.4.4325-1bf240a65_amd64.deb
sudo dpkg -i plexmediaserver_1.9.4.4325-1bf240a65_amd64.deb
  • View Plex at http://<yourhostname>:32400/web/index.html (The Plex service auto-starts by default)
  • Plex is unsecured by default, but should prompt you to "claim" your server with a Plex account on first login.
  • Set up Plex to watch directories where media is managed by Sonarr and Radarr.
  • For first-time Plex setup, you must access the Plex UI from the same subnet as the server. If it is a remote server and that's not possible, you'll need to do the first-time setup through an SSH tunnel:
# From your local machine:
ssh ip.address.of.server -L 8888:localhost:32400

Bookmarks

  • Deluge: http://<yourhostname>:8112
  • Jackett: http://<yourhostname>:9117/UI/Dashboard
  • Sonarr: http://<yourhostname>:8989
  • Radarr: http://<yourhostname>:7878
  • Plex: http://<yourhostname>:32400/web/index.html

Optional extra step: you can use something like https://organizr.us/ to eliminate the need for all those bookmarks.

[Unit]
Description=Deluge Bittorrent Client Web Interface
Documentation=man:deluge-web
After=network-online.target deluged.service
Wants=deluged.service
[Service]
Type=simple
User=deluge
Group=deluge
UMask=027
ExecStart=/usr/bin/deluge-web
Restart=on-failure
[Install]
WantedBy=multi-user.target
[Unit]
Description=Deluge Bittorrent Client Daemon
Documentation=man:deluged
After=network-online.target
[Service]
Type=simple
User=deluge
Group=deluge
UMask=000
ExecStart=/usr/bin/deluged -d
Restart=on-failure
# Time to wait before forcefully stopped.
TimeoutStopSec=300
[Install]
WantedBy=multi-user.target
[Unit]
Description=Jackett Daemon
After=network.target
[Service]
WorkingDirectory=/opt/Jackett/
User=<yourusername>
ExecStart=/usr/bin/mono --debug JackettConsole.exe --NoRestart
Restart=always
RestartSec=2
Type=simple
TimeoutStopSec=5
[Install]
WantedBy=multi-user.target
[Unit]
Description=Radarr Daemon
After=syslog.target network.target
[Service]
User=<yourusername>
Group=<yourgroupname>
Type=simple
ExecStart=/usr/bin/mono --debug /opt/Radarr/Radarr.exe --nobrowser
TimeoutStopSec=20
KillMode=process
Restart=always
[Install]
WantedBy=multi-user.target
[Unit]
Description=Sonarr Daemon
After=network.target
[Service]
User=<yourusername>
Group=<yourgroupname>
Type=simple
ExecStart=/usr/bin/mono /opt/NzbDrone/NzbDrone.exe -nobrowser
TimeoutStopSec=20
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment