Installing Qbittorrent manually to a FreeNAS jail with an already operating VPN connection is the best way to get a secure instance of a bittorrent client up and running to download all your media privately and without worrying your ISP or somebody else is tracking your activity. Installing it in a jail allows you to pair it easily with a VPN connection while ensuring that the rest of your system does not suffer from reduced speeds of always being connected to a VPN. Before following the instructions in this article you can setup a VPN connection by following the instrucitons in this article: FreeNAS: Add VPN Connection to a Jail. This article will show you how to install Qbittorrent into an existing jail, such as one with an established VPN connection and thankfully the process is pretty straight forward. If you do want Qbittorrent in a stand alone jail, you may want to consider just installing it via the FreeNAS web interface by selecting
Plugins -> Available -> Qbittorrent and following the install instructions there. Alright! Let’s jump in!
This article is part of my series of FreeNas setup, configuration and install articles.
UPDATE: I have updated this article for TrueNAS and you can read the TrueNAS: Qbittorrent Manual Install article.
Well, this part is pretty straight forward. Once you have created a new jail with your VPN connection as shown in the FreeNAS: Add VPN Connection to a Jail article, go to shell prompt for that jail and enter the following:
pkg install qbittorrent-nox
If you get an error that the package cannot be found, it is probably because you created the jail via the FreeNAS plugins interface. To fix this follow the instructions in this article: FreeNAS: No Packages Available to Install Have Been Found in the Repositories.
Setting Qbittorrent to Start on Jail Boot
There are other instructions out there on the web (such as this one, which frustratingly is one of the top google results) which would have you create and edit a
/etc/rc.d/qbittorrent however this is probably not the best way to set things up as this directory is reserved for applications that are part of the â€œbaseâ€ system. So instead, we will work from the
/usr/local/etc/rc.d/qbittorrent folder. In this folder there should be a file for each of the services which run on start up. If you have followed my guide (FreeNAS: Add VPN Connection to a Jail) which creates on OpenVPN connection for your jail, you will see
openvpn. In this directory there should also be a
qbittorrent which was created by the Qbittorrent install. This file should look like this.
# PROVIDE: qbittorrent
# REQUIRE: DAEMON
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable this service:
# qbittorrent_enable: Set to NO by default. Set it to YES to enable it.
# qbittorrent_conf_dir: Directory where qbittorrent configuration
# data is stored.
# Default: /var/db/qbittorrent/conf
# qbittorrent_download_dir: Directory to store downloaded data.
# Default: /var/db/qbittorrent/Downloads
# qbittorrent_user: The user account transmission daemon runs as.
# Default is ‘qbittorrent’
# qbittorrent_group: The group associated with username qbittorrent
# daemon runs as. Default is ‘qbittorrent’
If it does, you are set and there is no need to change anything here. However as you will see referenced in the text of this file, we do need to edit the file
/etc/rc.conf and add at least one line in there. Open the nano editor with the following command:
You will need to add the following at the end of the file:
Save the file and exit nano by pressing Ctrl-X.
Start qbittorrent using the following:
service qbittorrent start
So, now you can exit the jail and restart it. Once it is back up, lets open up a webbrowser and point to [YourLocalIP]:8080. This should bring up the Qbittorrent web interface. Login with the default credentials: user:admin password:adminadmin. If that work, you now have Qbittorrent up and running.
Changing Default Qbittorrent Uses
Installing Qbittorrent this way will also set it to run as the default user ‘qbittorrent’, which is also automatically created by the qbittorrent install. I have not been able to get it to run as a different user, however running as this user has worked fine, so I haven’t experimented further. As always, you will need to be very careful with user file permissions both with the jail and how they related to the larger FreeNAS server users. Changing the user should be a simple matter of editting the the
/etc/rc.conf file and adding something like the following: