How do I add a VPN to Qbittorrent?

Hello, so I looked at a couple tutorials and they all seem outdated to the current truenas/qbittorrent version that I have. How would I set it up? Ideally I would like qbittorrent to be the only app using the vpn as to not hinder jellyfins streaming performance. If it is not possible, would a SOCKS5 proxy do the trick? How would I go about doing that?

Qbittorrent version: 4.6.5
Truenas Scale version: 24.04.2
VPN being used: PIA

Do you need to do it at NAS level? If you have a router like pfSense/OPNSense, a simplest solution is to set up routing via VPN gateway, based on origin IP/port. You get added benefit of being protected from IP leaks, and while initial setup is quite lengthy (but there’s plenty step by step of tutorials online), it saves you a lot of headaches by messing up with configuration files later down the line. You can also “VPN-ise” any other app you might want to use in the future in literally 30 seconds.

you can do it setting up a wireguard interface. this is a good starting point: https://forums.truenas.com/t/guide-qbittorrent-app-with-wireguard-vpn/6003

If you’re using docker in Truenas, you can try using gluetun to route all qbittorent traffic to it.

The community version of qbittorrent doesn’t have VPN support. SOCKS5 would work, not sure on the throughout penalty tho.

Truecharts was the only easily configured chart but they deleted their repo.

You could roll out a custom app and use one of the images that have openvpn, not really sure how easy that will be to get working.

Easiest way would be to use a jailmaker sandbox, there are numerous docker-compose examples in how to get it to work.

I still have the TC app installed, but it’s been removed from any automation app for now.

Eagerly awaiting EE beta!

I just posted my guide to run any app with VPN (openvpn or wireguard) on TrueNas Electric Eel: https://forums.truenas.com/t/how-to-install-qbittorrent-or-any-app-with-vpn-on-truenas-electric-eel/12677

look up dyonr/qbittorrentvpn

I did this a few days ago using a custom app and the binhex/arch-qbittorrentvpn image along with a pia vpn.

It works great apart from slow startup speed but that might be my setup.

Nope just qbitorrent. My router doesnt support vpns. (its an eero router)

This is what I did, because I had experiences where a vpn on the container failed and my public ip was leaked.

Binhex image works fine as a custom app. Just follow the compose file

If you have a working TC qbittorrent app already installed, would I be incorrect to assume that you would be able to just copy a handful of directories/configs from the TC qbittorrent filesystem to the community version filesystem… and it would just work?

is there a drawback to using a socks5 proxy to a an actual vpn?

Awesome, thanks for making this guide. I updated my server to the Beta release of Electric Eel, and was able to easily follow your guide to setup my qBittorrent running through AirVPN wireguard with port forwarding. I was even able to use all my folders and config setup with the older TrueCharts release perfectly. qBittorrent started up and had my previous username and password, and was even still bound to only use the tun0 network interface. On top of that, with the truecharts release to get it working properly I had to use OpenVPN, but with your guide I was able to switch over to wireguard, and this allowed me to be fully connectable on private torrent servers, that had issues before.

Now I just need to figure out how to get domain forwarding working again, as I was using traefik before for websites for all my servers. Now everything is just locally accessible.

Edit: There we go, go everything transferred over and working properly with Caddy and cloudflare, no longer going through Truecharts.

Where exactly do you configure your other apps or other containers so they are using “service: gluetun”?

Any chance you could make a quick guide. I feel like I’ve done everything correctly in terms of the variables but my webportal never loads.

How would I install it?

I’ll check it out, thanks.

Did you get the VPN part to work? I used the hotio/qbitttorrent image which has a vpn built in. I can get qbit to work but never the vpn part

If you didn’t care what port is used, you could spin up the community version then open both QBT web UIs and just set the settings the same. Probably a .conf file in the PVC somewhere. If you’re using it as a seedbox or want history, then you’ll need to figure out where that all lives.

BUT the community version doesn’t have vpn support, which is the reason I haven’t swapped.