qBittorrent web UI says Unauthorized or won't open
Symptoms
Section titled “Symptoms”- The browser shows
Unauthorizedinstead of the qBittorrent page. - The login page rejects your username and password.
- The page doesn’t load at all.
- For qBittorrent VPN, the container is running but the web page is empty or times out.
UnauthorizedMost of the time it is one of these:
- You use the wrong address or port.
- You changed the password and forgot it, or the default login no longer works.
- qBittorrent blocked your IP address after several wrong logins.
- For qBittorrent VPN, the web page port is no longer set up in Gluetun, or Gluetun isn’t running or can’t connect to your VPN provider.
Work through the steps in order. Stop when the web UI opens.
1. Use the right address
Section titled “1. Use the right address”-
Find your server’s local IP address. Use it instead of
localhostin the browser. -
Find the port. Open your
.envfile in your Docker folder and look for the port variable:- qBittorrent:
QBITTORRENT_PORT. The default is8081. - qBittorrent VPN:
QBITTORRENTVPN_PORT. The default is8082.
- qBittorrent:
-
Open this address. Replace
YOUR_SERVER_IPwith your server’s IP address andPORTwith the number from step 2:http://YOUR_SERVER_IP:PORT -
Use
http, nothttps.
qBittorrent VPN can’t be put behind Traefik, so always open it this way. Plain qBittorrent can also have a Traefik address if you set one up.
2. Try the default login
Section titled “2. Try the default login”Deployrr sets the login to this when it installs qBittorrent:
- Username:
admin - Password:
adminadmin
qBittorrent VPN starts with the username admin and a temporary password that qBittorrent prints in its log. Read it as in step 5, items 6 to 8. You don’t need to stop the container or edit the config file first. It prints a new one every time it starts until you set your own.
If you changed the password and it no longer works, go to step 5.
3. Clear an IP ban
Section titled “3. Clear an IP ban”qBittorrent blocks your IP address for a while after several wrong logins. Restarting the container clears the block.
-
Run this for qBittorrent. For qBittorrent VPN, use
qbittorrent-vpninstead, here and in the commands below:Terminal window sudo docker restart qbittorrentWith the Deployrr bash aliases:
dcrestart qbittorrent. -
Open the web page again and log in.
4. Check that the container runs (qBittorrent VPN)
Section titled “4. Check that the container runs (qBittorrent VPN)”qBittorrent VPN has no port of its own. You reach it through Gluetun, so both containers must run.
-
List the containers:
Terminal window sudo docker psWith the aliases:
dps. -
Check that
gluetunandqbittorrent-vpnboth show asUp. Ifgluetunkeeps restarting, read its log:Terminal window sudo docker logs gluetunWith the aliases:
dlogs gluetun. It follows the log live; press Ctrl+C to stop.Gluetun must be set up with your VPN provider and connected. If its log shows it can’t connect, fix the VPN settings first. qBittorrent VPN can’t work without it. For the full install order and the VPN details Gluetun asks for, see Install qBittorrent VPN.
-
Open the Gluetun file in the
compose/HOSTNAMEfolder inside your Docker folder.HOSTNAMEis your server’s hostname. The file isgluetun.yml. -
Find the
portssection. It must have this line without a#in front:ports:- $QBITTORRENTVPN_PORT:8080In a fresh Gluetun install, both lines start with
#. Installing qBittorrent VPN removes the#.To see why the web UI port is set on the Gluetun container, watch Gluetun guide: putting qBittorrent behind the VPN kill switch at 13:23. It is a manual Docker Compose setup; Deployrr does this for you. Skip its Traefik labels part: Deployrr doesn’t put qBittorrent VPN behind Traefik.
-
If the line is missing or has a
#in front, install qBittorrent VPN again: Apps > Browse Apps > qBittorrent VPN > Install. At the Already Installed prompt, choose Yes. The install adds the line back, restarts Gluetun and starts qBittorrent VPN again. -
If you restart Gluetun yourself later, restart qBittorrent VPN after it:
Terminal window sudo docker restart qbittorrent-vpnWith the aliases:
dcrestart qbittorrent-vpn. If you recreate or reinstall Gluetun, recreate qBittorrent VPN instead (dcrec qbittorrent-vpn). See If Gluetun doesn’t connect.
5. Reset the password
Section titled “5. Reset the password”-
Stop the container. Use
qbittorrent-vpninstead for qBittorrent VPN:Terminal window sudo docker stop qbittorrentWith the aliases:
dstop qbittorrent. -
Open the qBittorrent config file. It is in your Docker folder, under
appdata/qbittorrent/qBittorrent/qBittorrent.conf. For qBittorrent VPN, the folder isappdata/qbittorrent-vpn/qBittorrent/qBittorrent.conf. -
Find the line that starts with
WebUI\Password_PBKDF2and delete it. -
Save the file.
-
Start the container:
Terminal window sudo docker start qbittorrentWith the aliases:
dcstart qbittorrent. -
Read the container log and find the temporary password. Current qBittorrent versions (4.6.1 and later) print one when no password is set:
Terminal window sudo docker logs qbittorrent 2>&1 | grep -i passwordUse the last line it prints. The
dlogs qbittorrentalias shows only the last 50 lines, so the password line may already be gone from it. -
Log in with your username (
adminunless you changed it) and the temporary password. -
In qBittorrent, open Tools, then Options, then WebUI. Set a new password and save. The temporary password only works until the container restarts.
If the log shows no temporary password, or you still can’t log in, reset qBittorrent to the default login and settings.
6. Check the host header settings
Section titled “6. Check the host header settings”For qBittorrent, Deployrr turns host header validation off for you. If you changed the config file, check that the [Preferences] section still has these lines:
WebUI\Address=*WebUI\ServerDomains=*WebUI\HostHeaderValidation=falseqBittorrent VPN starts with only the first two lines. That is enough, because ServerDomains=* accepts any address you open it with.
If you change the file, stop the container first and start it again after you save. qBittorrent can overwrite your edits while it runs.
To see the same fix done by hand, watch qBittorrent Docker Compose guide: fixing the Unauthorized error at 8:28. It is a manual Docker Compose setup; Deployrr does this for you.
7. Check the apps that connect to qBittorrent
Section titled “7. Check the apps that connect to qBittorrent”If the web page works but Sonarr or Radarr can’t connect, the host and port are probably wrong. Apps connect with a container name and the internal port, not the port you use in your browser. See Connect your apps to each other.
Reset to the default login and settings
Section titled “Reset to the default login and settings”Use this when the password reset in step 5 doesn’t get you in, or when a setting you changed in Options stops the web UI from opening, such as the web UI port, HTTPS or the address it listens on. Installing the app again resets its config file. The steps are the same for qBittorrent and qBittorrent VPN, but the result differs a little.
What the reinstall changes:
- qBittorrent:
qBittorrent.confis replaced with Deployrr’s copy. The login goes back toadminandadminadmin, host header validation is off, and the download folders are the ones under/data/downloads/torrents/. - qBittorrent VPN:
qBittorrent.confis deleted, and the container starts with the image’s own default settings. The login isadminwith a temporary password from the log, and the download folder is/downloads/. Change it to a folder under/data/downloads/torrents/(step 5 below). - Everything else you set in Options goes back to qBittorrent’s default.
- Only that one file changes. The other files in the app’s appdata folder stay.
- The container is recreated with the latest image, and the app’s compose file is replaced. Changes you made to it by hand are lost.
Steps:
-
Back up the config file so you can see your old settings later. Replace
YOUR_USERwith your Linux username anddockerwith your Docker folder if it is somewhere else. For qBittorrent VPN, useappdata/qbittorrent-vpnin the path:Terminal window sudo cp /home/YOUR_USER/docker/appdata/qbittorrent/qBittorrent/qBittorrent.conf ~/qBittorrent.conf.bak -
Go to Apps > Browse Apps > qBittorrent (or qBittorrent VPN) > Install. At the Already Installed prompt, choose Yes. You can also use Reinstall in Manage Apps when the app is stopped. See Reinstall an app and keep its data.
-
For qBittorrent VPN, check that both
gluetunandqbittorrent-vpnshow asUpinsudo docker ps -a. Ifqbittorrent-vpnisn’t running, start it as in step 4, item 5 of Install qBittorrent VPN. -
Log in with
adminandadminadmin. For qBittorrent VPN, useadminand the temporary password fromsudo docker logs qbittorrent-vpn 2>&1 | grep -i password. Set a new password right away in Tools > Options > WebUI. -
For qBittorrent VPN, open Tools > Options > Downloads. Set Default Save Path to
/data/downloads/torrents/others/. If you use an incomplete folder, set it to/data/downloads/torrents/incomplete/. Files saved under/downloads/stay inside the container and don’t reach your Downloads Folder. See Sonarr, Radarr or Lidarr don’t import finished downloads. -
Put the new password in every app that connects to qBittorrent, such as Sonarr and Radarr. Their download client settings hold the qBittorrent username and password.
-
To see which settings you had changed, compare the backup with the new file:
Terminal window sudo diff ~/qBittorrent.conf.bak /home/YOUR_USER/docker/appdata/qbittorrent/qBittorrent/qBittorrent.confFor qBittorrent VPN, use
appdata/qbittorrent-vpnin the path. Set the settings you want again in Options. Don’t copy back the line that broke the web UI.
Check it worked
Section titled “Check it worked”- The qBittorrent login page opens at
http://YOUR_SERVER_IP:PORT. - You log in and see the torrent list.
- For qBittorrent VPN, both
gluetunandqbittorrent-vpnshow asUpinsudo docker ps(ordps).
If it still fails, read the qBittorrent log and look for the last error lines. You can also run dlogs qbittorrent from Bash aliases. It follows the log live; press Ctrl+C to stop.
sudo docker logs qbittorrent
