This post documents the steps required to install qBittorrent, Jackett, Lidarr, Radarr, Sonarr, and Plex in TrueNAS jails version 12.0-U6.

The FN11.3 iocage jails - Plex, Tautulli, Sonarr, Radarr, Lidarr, Jackett, Transmission, Organizr guide inspired me to write this guide. I’ll also briefly cover permissions.

Disclaimer

From Wikipedia on BitTorrent Legislation:

Although the protocol itself is legal, problems stem from using the protocol to traffic copyright infringing works, since BitTorrent is often used to download otherwise paid content, such as movies and video games.

See also: Legal issues with BitTorrent (Wikipedia)

I’ll only cover options that deviate from the defaults. I use DHCP reservations to manage my server IPs, so I use the dhcp=1 option to create jails.

Note that using hardlinks with the *arrs doesn’t work with this setup. For hardlinking to work, the torrent client and *arrs must share the same dataset and jail mount points.

Goals

The diagram above translates to the following requirements:

  • Each service lives inside a separate jail
  • Each service inside the jail runs as a different user
  • Each jail owns a dataset for configuration data
  • Jails share media datasets, but only one user has write permissions. E.g., Radarr can only read (ro) from the torrent dataset but write (rw) to the movies dataset.

Groups

Navigate to AccountsGroups and add the following groups.

GID850
Nameqbittorrent
Samba Authenticationunchecked
GID354
Namejackett
Samba Authenticationunchecked
GID356
Namelidarr
Samba Authenticationunchecked
GID352
Nameradarr
Samba Authenticationunchecked
GID351
Namesonarr
Samba Authenticationunchecked
GID972
Nameplex
Samba Authenticationunchecked

Users

Navigate to AccountsUsers and add the following users.

Full NameqBittorrent
Usernameqbittorrent
User ID850
New Primary Groupunchecked
Primary Groupqbittorrent
Primary Groupqbittorrent
Disable PasswordYes
Shellnologin
Samba Authenticationunchecked
Full NameJackett
Usernamejackett
User ID354
New Primary Groupunchecked
Primary Groupjackett
Disable PasswordYes
Shellnologin
Samba Authenticationunchecked
Full NameLidarr
Usernamelidarr
User ID356
New Primary Groupunchecked
Primary Grouplidarr
Disable PasswordYes
Shellnologin
Samba Authenticationunchecked
Full NameRadarr
Usernameradarr
User ID352
New Primary Groupunchecked
Primary Groupradarr
Disable PasswordYes
Shellnologin
Samba Authenticationunchecked
Full NameSonarr
Usernamesonarr
User ID351
New Primary Groupunchecked
Primary Groupsonarr
Disable PasswordYes
Shellnologin
Samba Authenticationunchecked
Full NamePlex
Usernameplex
User ID972
New Primary Groupunchecked
Primary Groupplex
Disable PasswordYes
Shellnologin
Samba Authenticationunchecked

Datasets

Navigate to StoragePools and add the datasets and permissions. We’ll use default 755 permissions for all datasets.

Jail Config Datasets

Path/mnt/vault0/apps/qbittorrent
Userqbittorrent
Apply Userchecked
Groupqbittorrent
Apply Groupchecked
Path/mnt/vault0/apps/jackett
Userjackett
Apply Userchecked
Groupjackett
Apply Groupchecked
Path/mnt/vault0/apps/lidarr
Userlidarr
Apply Userchecked
Grouplidarr
Apply Groupchecked
Path/mnt/vault0/apps/radarr
Userradarr
Apply Userchecked
Groupradarr
Apply Groupchecked
Path/mnt/vault0/apps/sonarr
Usersonarr
Apply Userchecked
Groupsonarr
Apply Groupchecked
Path/mnt/vault0/apps/plex
Userplex
Apply Userchecked
Groupplex
Apply Groupchecked

Media Datasets

Path/mnt/vault0/media/torrents
Userqbittorrent
Apply Userchecked
Groupqbittorrent
Apply Groupchecked
Path/mnt/vault0/media/music
Userlidarr
Apply Userchecked
Grouplidarr
Apply Groupchecked
Path/mnt/vault0/media/movies
Userradarr
Apply Userchecked
Groupradarr
Apply Groupchecked
Path/mnt/vault0/media/series
Usersonarr
Apply Userchecked
Groupsonarr
Apply Groupchecked

Jails

Connect to TrueNAS via SSH or similar.

qBittorrent Jail

# Create jail
iocage create --name qbittorrent --release 12.2-RELEASE dhcp=1 boot=1
# Mount jail config dataset
iocage exec qbittorrent mkdir /mnt/config
iocage fstab --add qbittorrent /mnt/vault0/apps/qbittorrent /mnt/config nullfs rw 0 0
# Mount media dataset
iocage exec qbittorrent mkdir /mnt/torrents
iocage fstab --add qbittorrent /mnt/vault0/media/torrents /mnt/torrents nullfs rw 0 0
# Update packages
iocage exec qbittorrent "pkg update && pkg upgrade"
# Install qBittorrent without GUI
iocage exec qbittorrent pkg install qbittorrent-nox
# Enable qBittorrent service
iocage exec qbittorrent sysrc qbittorrent_enable=YES
# Configure config directory
iocage exec qbittorrent sysrc qbittorrent_conf_dir=/mnt/config
# Start the service
iocage exec qbittorrent service qbittorrent start

Navigate to http://<jail IP>:8080 in your browser and login with the default credentials.

UsernamePassword
adminadminadmin

Navigate to ToolsOptions... and change the Default Save Path to /mnt/torrents:

Screenshot of qBittorrent options

Jackett Jail

# Create jail
iocage create --name jackett --release 12.2-RELEASE dhcp=1 boot=1
# Mount jail config dataset
iocage exec jackett mkdir /mnt/config
iocage fstab --add jackett /mnt/vault0/apps/jackett /mnt/config nullfs rw 0 0
# Change pkg repository set from `quarterly` to `latest`
# At the time of this writing, `jackett` from the quarterly repo wasn't working
iocage exec jackett sed -i '' 's/quarterly/latest/g' /etc/pkg/FreeBSD.conf
# Update packages
iocage exec jackett "pkg update && pkg upgrade"
# Install
iocage exec jackett pkg install jackett
# Enable service
iocage exec jackett sysrc jackett_enable=YES
# Configure config directory
iocage exec jackett sysrc jackett_data_dir=/mnt/config
# Start the service
iocage exec jackett service jackett start

Navigate to http://<jail IP>:9117 in your browser to use Jackett.

Lidarr Jail

# Create jail
iocage create --name lidarr --release 12.2-RELEASE dhcp=1 boot=1
# Mount jail config dataset
iocage exec lidarr mkdir /mnt/config
iocage fstab --add lidarr /mnt/vault0/apps/lidarr /mnt/config nullfs rw 0 0
# Mount media datasets
iocage exec lidarr mkdir /mnt/music
iocage fstab --add lidarr /mnt/vault0/media/music /mnt/music nullfs rw 0 0
iocage exec lidarr mkdir /mnt/torrents
iocage fstab --add lidarr /mnt/vault0/media/torrents /mnt/torrents nullfs ro 0 0
# Change pkg repository set from `quarterly` to `latest`
iocage exec lidarr sed -i '' 's/quarterly/latest/g' /etc/pkg/FreeBSD.conf
# Update packages
iocage exec lidarr "pkg update && pkg upgrade"
# Install
iocage exec lidarr pkg install lidarr
# Enable service
iocage exec lidarr sysrc lidarr_enable=YES
# Configure config directory
iocage exec lidarr sysrc lidarr_data_dir=/mnt/config
# Start the service
iocage exec lidarr service lidarr start

Navigate to http://<jail IP>:8686 in your browser to use Lidarr.

Radarr Jail

# Create jail
iocage create --name radarr --release 12.2-RELEASE dhcp=1 boot=1 allow_mlock=1
# Mount jail config dataset
iocage exec radarr mkdir /mnt/config
iocage fstab --add radarr /mnt/vault0/apps/radarr /mnt/config nullfs rw 0 0
# Mount media datasets
iocage exec radarr mkdir /mnt/movies
iocage fstab --add radarr /mnt/vault0/media/movies /mnt/movies nullfs rw 0 0
iocage exec radarr mkdir /mnt/torrents
iocage fstab --add radarr /mnt/vault0/media/torrents /mnt/torrents nullfs ro 0 0
# Change pkg repository set from `quarterly` to `latest`
iocage exec radarr sed -i '' 's/quarterly/latest/g' /etc/pkg/FreeBSD.conf
# Update packages
iocage exec radarr "pkg update && pkg upgrade"
# Install
iocage exec radarr pkg install radarr
# Enable service
iocage exec radarr sysrc radarr_enable=YES
# Configure config directory
iocage exec radarr sysrc radarr_data_dir=/mnt/config
# Start the service
iocage exec radarr service radarr start

Navigate to http://<jail IP>:7878 in your browser to use Radarr.

Sonarr Jail

# Create jail
iocage create --name sonarr --release 12.2-RELEASE dhcp=1 boot=1
# Mount jail config dataset
iocage exec sonarr mkdir /mnt/config
iocage fstab --add sonarr /mnt/vault0/apps/sonarr /mnt/config nullfs rw 0 0
# Mount media datasets
iocage exec sonarr mkdir /mnt/series
iocage fstab --add sonarr /mnt/vault0/media/series /mnt/series nullfs rw 0 0
iocage exec sonarr mkdir /mnt/torrents
iocage fstab --add sonarr /mnt/vault0/media/torrents /mnt/torrents nullfs ro 0 0
# Change pkg repository set from `quarterly` to `latest`
iocage exec sonarr sed -i '' 's/quarterly/latest/g' /etc/pkg/FreeBSD.conf
# Update packages
iocage exec sonarr "pkg update && pkg upgrade"
# Install
iocage exec sonarr pkg install sonarr
# Enable service
iocage exec sonarr sysrc sonarr_enable=YES
# Configure config directory
iocage exec sonarr sysrc sonarr_data_dir=/mnt/config
# Start the service
iocage exec sonarr service sonarr start

Navigate to http://<jail IP>:8989 in your browser to use Sonarr.

Plex Jail

# Create jail
iocage create --name plex --release 12.2-RELEASE dhcp=1 boot=1
# Mount jail config dataset
iocage exec plex mkdir /mnt/config
iocage fstab --add plex /mnt/vault0/apps/plex /mnt/config nullfs rw 0 0
# Mount media datasets
iocage exec plex mkdir /mnt/music
iocage fstab --add plex /mnt/vault0/media/music /mnt/music nullfs ro 0 0
iocage exec plex mkdir /mnt/series
iocage fstab --add plex /mnt/vault0/media/series /mnt/series nullfs ro 0 0
iocage exec plex mkdir /mnt/movies
iocage fstab --add plex /mnt/vault0/media/movies /mnt/movies nullfs ro 0 0
# Update packages
iocage exec plex "pkg update && pkg upgrade"
# Install
iocage exec plex pkg install plexmediaserver
# Enable service
iocage exec plex sysrc plexmediaserver_enable=YES
# Configure config directory
iocage exec plex sysrc plexmediaserver_support_path=/mnt/config
# Start the service
iocage exec plex service plexmediaserver start

Navigate to http://<jail IP>:32400/web in your browser to use Plex.