I am not going the packaged way (as in use the Debian/ Ubuntu package) so I will set things up manually.
Note: These steps are not to encourage or promote illegal downloading of movies or TV shows. I was curious and wanted to try these software and the steps below are only meant as a reference for anyone else similarly curious. Please watch your favourite movies or TV shows via Netflix, Amazon Prime Video, HBO, etc.
Download
- Install Mono. Official steps are here. I am going to go with the official steps for Debian as I am running the 64-bit Raspberry Pi OS and I think that track Debian. One needs
mono-complete
as the more basicmono-runtime
isn’t enough.
123456789sudo apt install apt-transport-https dirmngr gnupg ca-certificatessudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EFecho "deb https://download.mono-project.com/repo/debian stable-buster main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.listsudo apt updatesudo apt install mono-complete -
Install MediaInfo (official steps here).
1234567wget https://mediaarea.net/repo/deb/repo-mediaarea_1.0-13_all.deb -O /tmp/repo-mediaarea_1.0-13_all.debsudo dpkg -i /tmp/repo-mediaarea_1.0-13_all.debsudo apt-get updatesudo apt install mediainfo - Create a user under whom all these will run. I’ll refer to it as
$DLDUSER
henceforth. Its home directory will be/opt/downloaders
which is where I’ll later extract Sonarr, Radarr, etc. to.1sudo adduser --system $DLDUSER --group --home /opt/downloaders - Download Sonarr and extract it:
1234567891011# Download the filecurl -sL "https://services.sonarr.tv/v1/download/phantom-develop/latest?version=3&os=linux" -o /tmp/Sonarr.tgz# Extract it to /opt/pi3dld (this will create a folder called Sonarr)sudo tar xvzf /tmp/Sonarr.tgz -C /opt/downloaders# Change the case (I like it that way)sudo mv /opt/downloaders/Sonarr /opt/downloaders/sonarr# Fix permissionssudo chown -R ${DLDUSER}:${DLDUSER}/opt/downloaders/sonarr
- Download Radarr and extract it (I am going with the arm64 version below; select your poison from the official downloads page):
1234567curl -sL "https://radarr.servarr.com/v1/update/nightly/updatefile?os=linux&runtime=netcore&arch=arm64" -o /tmp/Radarr.tgzsudo tar xvzf /tmp/Radarr.tgz -C /opt/downloaders/sudo mv /opt/downloaders/Radarr /opt/downloaders/radarrsudo chown -R ${DLDUSER}:${DLDUSER} /opt/downloaders/radarr
- Ditto for Jackett (if you want to do torrents too)(replace ARM64 with ARM32 in the URL below if you are not on the 64-bit OS).
1234567curl -sL "https://github.com/Jackett/Jackett/releases/latest/download/Jackett.Binaries.LinuxARM64.tar.gz" -o /tmp/Jackett.tgzsudo tar xvzf /tmp/Jackett.tgz /opt/downloaderssudo mv /opt/downloaders/Jackett /opt/downloaders/jackettsudo chown -R ${DLDUSER}:${DLDUSER} /opt/downloaders/Jackett
- Install transmission (my choice for torrents; feel free to skip if you don’t want torrents).
1sudo apt install transmission-daemon
- Install NZBGet (a newsgroup download client).
123456wget -q https://nzbget.net/download/nzbget-latest-bin-linux.run -O /tmp/nzbget-latest-bin-linux.run# you can skip --arch aarch64 to auto-detect the architecturesudo sh /tmp/nzbget-latest-bin-linux.run --destdir /opt/${DLDUSER}/NZBGet --arch aarch64sudo chown -R ${DLDUSER}:${DLDUSER} /opt/${DLDUSER}/NZBGet
Create Services
At this point I’ve downloaded everything. I’d like to make some services so all these launch automatically. I also have a disk where I’d like to download stuff to – I want that too to be mounted via systemd and all other services depend upon it so they don’t start if this disk is not mounted.
Disk
Make a file called /etc/systemd/system/mnt-disk.mount
with the following:
1 2 3 4 5 6 7 8 9 10 11 12 |
[Unit] Description=External Disk [Mount] What=/dev/disk/by-uuid/2f2353e2-6e17-4fa3-a152-05b87b2f14f1 Where=/mnt/disk Type=ext4 Options=defaults,users [Install] WantedBy=multi-user.target RequiredBy=nzbget.service |
I found the UUID by browsing to /dev/disk/by-uuid
and identifying my disk. Since I want to mount this to /mnt/disk
the file must be mnt-disk.mount
. Rename your file and path if needed.
Enable it: sudo systemctl enable mnt-disk.mount
NZBGet
Make a file /etc/systemd/system/nzbget.service
with the following (note that the service name matches the dependency in the mnt-disk.mount
file above):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
[Unit] Description=NZBGet Daemon After=syslog.target network.target Requires=mnt-disk.mount StartLimitIntervalSec=0 [Service] # Change the user and group variables here. User=$DLDUSER Group=$DLDUSER Type=forking # Pass any command line arguments etc. ExecStart=/opt/downloaders/nzbget/nzbget -D -c /opt/downloaders.conf/nzbget/nzbget.conf ExecStop=/opt/downloaders/nzbget/nzbget -Q -c /opt/downloaders.conf/nzbget/nzbget.conf ExecReload=/opt/downloaders/nzbget/nzbget -O -c /opt/downloaders.conf/nzbget/nzbget.conf TimeoutStopSec=20 KillMode=process Restart=on-failure RestartSec=5 # Sandboxing ... (see https://www.freedesktop.org/software/systemd/man/systemd.exec.html for more info) ReadWritePaths=/opt/downloaders/nzbget /opt/downloaders.conf/nzbget /mnt/disk ProtectSystem=strict PrivateDevices=true ProtectHome=true [Install] WantedBy=multi-user.target Alias=nzbget.service RequiredBy=sonarr.service radarr.service |
Couple of things to note here:
- Replace
$DLDUSER
with the username you are using - Replace
/opt/downloaders/nzbget /opt/downloaders.conf/nzbget /mnt/disk
with whatever paths you want NZBGet to have write access to. I am limiting it to its program folder, config folder, and the disk where it will download stuff to. - Notice I am specifying a separate folder for the config. This is my way of separating the config from the actual program. Keep it easy to move things around later.
Enable it: sudo systemctl enable nzbget.service
Transmission
Transmission in Debian installs a service but I don’t want to use that. So disable it: sudo systemctl disable transmission-daemon.service
Then make /etc/systemd/system/transmission.service
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
[Unit] Description=Transmission Daemon After=network.target Requires=mnt-disk.mount [Service] User=$DLDUSER Group=$DLDUSER Type=notify ExecStart=/usr/bin/transmission-daemon -f --log-error -g /opt/downloaders.conf/transmission ExecStop=/bin/kill -s STOP $MAINPID ExecReload=/bin/kill -s HUP $MAINPID [Install] WantedBy=multi-user.target Alias=transmission.service RequiredBy=jackett.service |
It is pretty similar to the default one with very minor changes.
Enable it: sudo systemctl enable transmission.service
Sonarr, Radarr, Jackett
Create /etc/systemd/system/sonarr.service
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
[Unit] Description=Sonarr Daemon After=syslog.target network.target Requires=nzbget.service StartLimitIntervalSec=0 [Service] User=$DLDUSER Group=$DLDUSER Type=simple ExecStart=/usr/bin/mono --debug /opt/downloaders/sonarr/Sonarr.exe -nobrowser -data=/opt/downloaders.conf/sonarr TimeoutStopSec=20 KillMode=process Restart=on-failure RestartSec=5 [Install] WantedBy=multi-user.target Alias=sonarr.service |
Create /etc/systemd/system/radarr.service
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
[Unit] Description=Radarr Daemon After=syslog.target network.target Requires=nzbget.service StartLimitIntervalSec=0 [Service] User=$DLDUSER Group=$DLDUSER Type=simple ExecStart=/opt/downloaders/radarr/Radarr -nobrowser -data=/opt/downloaders.conf/radarr TimeoutStopSec=20 KillMode=process Restart=on-failure RestartSec=5 [Install] WantedBy=multi-user.target Alias=radarr.service |
Create /etc/systemd/system/jackett.service
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
[Unit] Description=Jackett Daemon After=syslog.target network.target Requires=transmission.service StartLimitIntervalSec=0 [Service] User=$DLDUSER Group=$DLDUSER Type=simple SyslogIdentifier=jackett Restart=on-failure RestartSec=5 WorkingDirectory=/opt/downloaders/jackett ExecStart=/bin/sh /opt/downloaders/jackett/jackett_launcher.sh TimeoutStopSec=30 [Install] WantedBy=multi-user.target Alias=jackett.service |