Last updated on 26 October 2024
Important or Recent Updates
Historic Updates | Date |
---|---|
Fresh new guide by popular demand | 28/09/2023 |
Updated with new steps to obtain and change WebUI password | 21/11/2023 |
Issue with passwords has been fixed in 4.6.2 so removed tty line from yaml | 29/11/2023 |
What is qBittorrent?
qBittorrent is a torrent downloader used to both manage torrent downloading and seeding.
If you are looking to combine a VPN with this set up see the GlueTUN guide on the left Menu
Let’s Begin
In this guide I will take you through the steps to get qBittorrent up and running in Docker
In order for you to successfully use this guide please complete the three preceding guides
- Docker Package, SSD and Memory Recommendations
- Step 1: Directory Setup Guide
- Step 2: Setting up a restricted Docker user
- Step 3: Setting up a Docker Bridge Network (synobridge)
Folder Setup
Let’s start by getting some folders set up for the containers to use. Open up File Station create the following.
/docker/projects/qbit-compose
/docker/qbittorrent
Container Manager
Next we are going to set up a ‘Project’ in Container Manager, a project is used when you want one or more to all be loaded together and uses Docker Compose to do this.
Open up Container Manager and click on Project then on the right-hand side click ‘Create’
In the next screen we will set up our General Settings, enter the following:
Section | Setting |
---|---|
Project Name: | qbit-project |
Path: | /docker/projects/qbit-compose |
Source: | Create docker-compose.yml |
Next we are going to drop in our docker compose configuration copy all the code in the box below and paste it into line ‘1’ just like the screenshot
services:
qbittorrent:
image: linuxserver/qbittorrent:latest
container_name: qbittorrent
environment:
- PUID=1234 #CHANGE_TO_YOUR_UID
- PGID=65432 #CHANGE_TO_YOUR_GID
- TZ=Europe/London #CHANGE_TO_YOUR_TZ
- WEBUI_PORT=8090
volumes:
- /volume1/docker/qbittorrent:/config
- /volume1/data/torrents:/data/torrents
ports:
- 9854:9854/tcp # Forwarded Port on Router TCP
- 9854:9854/udp # Forwarded Port on Router TCP
- 8090:8090/tcp # port for qbittorrent webui
network_mode: synobridge
restart: always
Environment Variables
We are now going to amend some key variables to make sure the container has access to our folders and also knows where we are in the world. Don’t change any other settings other than those I mention.
Variable | Value |
---|---|
PUID | (required) The UID you obtained in the user setup guide |
PGID | (required) The GID you obtained in the user setup guide |
TZ | (required) Your timezone wikipedia.org/wiki/List_of_tz_database_time_zones |
Ports
Nothing to change here, the webui will run on port 8090 and the ports we will be using for the torrent protocol will be 9854 for TCP and UDP.
Volumes
By default, I have assumed you have your config files stored on /volume1 if these are located on another volume amend this line accordingly.
Click ‘Next’
You do not need to enable anything on the ‘Web portal settings’ screen click ‘Next’ again
On the final screen click Done which will begin the download of the container images and once downloaded they will be launched!
The images will now be downloaded and extracted. You should see ‘Code 0’ when it has finished.
You will now see your qbit-project running with a green status on the left-hand side.
Firewall Exceptions
(Skip if you don’t have the Firewall configured)
If you have the Synology Firewall enabled please see this additional guide for further info on exceptions and correct set up.
Changing the default WebUI login and password
If you skip this step you won’t be able to log in.
Now the container has started open it in the Docker UI by clicking the qbittorrent container select ‘details’ and then view the ‘log’ tab. Within the logs you will see the login details.
Now before doing any more of the guide go to the Web UI by going to the IP of your NAS followed by port 8090 and log in. Then on the WebUI tab change the defaults to your own and save them.
Now continue on..
Router Port Forwarding
As you can imagine there are thousands of possible router configs out there, so you will need to check the manual for your own.
Essentially you need to Port Forward port 9854 TCP and UDP to your NAS IP address. This will make you connectable for all peers. Most routers support UPnP or NAT-PNP which will automatically set up ports however it’s usually more secure to turn these off and do it manually.
Final qBittorrent steps
File Paths
As we have used /data/torrents as the mount point for our downloads we need to make sure qBittorrent uses this same file path.
We need to change the file paths by editing the qBittorrent config file, before doing this stop both of the containers. Do this by selecting the Project from the main UI and under Action selecting ‘Stop’.
You can edit this file in a number of ways, but to keep the guide OS-agnostic we will be using the Synology Text Editor package which can be installed via Package Center.
Open Text Editor and browse to /docker/qbittorrent/qbittorrent and open the qBittorrent.conf then edit the file in line with the table below, once amended save the changes.
Original Value | New Value |
---|---|
Session\DefaultSavePath=/downloads/ | Session\DefaultSavePath=/data/torrents/completed |
Session\TempPath=/downloads/incomplete/ | Session\TempPath=/data/torrents/incoming/ |
Downloads\SavePath=/downloads/ | Downloads\SavePath=/data/torrents/completed |
Downloads\TempPath=/downloads/incomplete/ | Downloads\TempPath=/data/torrents/incoming/ |
You can now bring the containers back up again by starting the Project.
Once the containers are running you can log into the Web UI by going to the IP of your NAS followed by port 8090
e.g. 192.168.0.30:8090
Log in with the username and password you created earlier.
Now you are in the UI click on settings cog at the top of the screen, we are going to change one more directory which is the watched folder to /data/torrents/watch
.
You can also turn on the option ‘keep incomplete torrents in:’ which should already have /data/torrents/incoming
prefilled.
Next we are going to set a command to run when each torrent finishes to automatically extract any .rar files (Note if you have any issues with this I would recommend using Unpackerr the guide is on the menu)
Scroll down in the options to the ‘Run external program on torrent completion’ and enter the below, it tells qbittorrent to run unrar and extract the file to the same save path as the original file. This will not delete anything, so you can continue seeding.
unrar x "%D/*.r*" "%D/"
Connection Settings
The last step is to tell qBittorrent to use the correct port for communication enter 9854 in the Listening Port.
I am not going to walk through all the other settings as you can customise these as you wish.
That’s it.
FAQs
Q: I am getting the ‘errored’ status for all my torrents
This is very likely a permissions issue, go to the User and Group guide and see the permission fixes towards the bottom.
Q: Everything seems to be connected but nothing is downloading.
Try grabbing the Ubuntu torrent as that is a sure fire way of testing as generally it has over 3k seeds.
Looking for some help, join our Discord community
If you are struggling with any steps in the guides or looking to branch out into other containers join our Discord community!
Buy me a beverage!
If you have found my site useful please consider pinging me a tip as it helps cover the cost of running things or just lets me stay hydrated. Plus 10% goes to the devs of the apps I do guides for every year.
Appreciate your work but i’m getting the following error…
Error response from daemon: Bind mount failed ‘/volume1/data/torrents’ d
exit code: 1
Double check you folders naming and they are all lowercase and are on volume1
Are there any risks associated with the configuration of port 9854 as shown in the final step? Does it need to be forwarded on my router? Do I have to secure that port via VPN in any fashion with gluetun in the yml file?
Thank you in advance! Everything has been working magnificently thus far and its all thanks to your guide!
Hey, so if you are using GlueTUN you should NOT be port forwarding anything on the Router side as this will run the risk of exposing qbit to your local WAN rather than via the VPN. If however you are using no VPN then you will need to open the port in order to be connectable via other torrent clients. Keep in mind that you need to make sure whatever you are uploading is legal where you live.
Hey thanks so much for your response. This clears things up for me and supplements some reading I’ve been doing since my initial post.
I did have another question that you may or may not be able to help with. I followed your guide for setup of qBit and gluetun, however, the upload/download speeds on qBit are extremely poor. I’ve tried the same downloads via my desktop version of qBit and they go much faster.
I ran some speed tests on the Synology NAS (DS1522+) itself, qBit container, and gluetun container. Here are the results of my speed tests:
The NAS itself:
Download = 934.29 Mbps
Upload = 103.92 Mbps
qBittorrent Container:
Download = 0.79 Mbit/s
Upload = 2.72 Mbit/s
gluetun Container:
Download = 21.38 Mbit/s
Upload = 52.70 Mbit/s
Any idea why qBit might be demonstrating such poor performance? Anything helps. I just simply don’t know where to go about solving this issue and whether or not it is solvable or just the nature of the setup.
From a VPN perspective the closer the server the better, however you seem to be getting some pretty poor performance off the VPN as well which points at some issue with Docker.
I would initially try a very close server to you, just to see if that helps with GlueTUN itself. Also, might be worth doing a reboot to make sure the Docker network has set up correctly. You are doing the right testing (spotted you on Reddit)
Your guides have been a blessing, as I’ve progressed a lot farther than a year or so ago when I first tried to setup qBittorrent.
Here is where I am getting stuck though. Instead of using sonarr, I am trying (because it’s what I know) to setup RSS Downloader to automatically download files and place them in their destined folder outside of /data. The folders are still on volume1, but instead scattered elsewhere on my NAS.
If I try to have RSS downloader automatically move those files there, they get stuck in the incoming folder upon completion. I can’t figure out the fix to this, as I’ve given dockerlimited and dockergroup read/write permissions to these folders. Is there somewhere else I need to give permission to outside of those user and groups? Anything glaring I would be overlooking to automatically move files outside of /data?
Oh hey, so this is an easy fix. In the guide we use the /data/torrents mount point so qbit cannot see outside of this.. adjust the yaml volumes section.
– /volume1/data:/data
This will allow qbit access to folders outside of the torrents folder.
You can add additional mount point if you wish for example as share called ‘othershare’ on volume1
– /volume1/othershare:/othershare
You are amazing, thank you! I would have never realized that piece, as I kept rebuilding and retracing the steps but overlooked that simple piece.
Followed this but all downloads stay in the incoming directory, not moved on completion and if I try to move them manually QBT gives the message “Cannot make save path”. Any ideas?
I would double-check the permissions for the completed folder, might be worth deleting it and recreating. Failing that jump back to the User and Group guide and check the permission fix towards the bottom.
After the installation I am getting an error:
Container qbittorrent Starting
Error response from daemon: network synobridge not found
You skipped a step at the start of the guide to create the user defined bridge.
Hi, I’ve done that, still have the error?
Hi, did you name it exactly ‘synobridge’ ? Or does it have a capital letter in it or something?