Connecting Sonarr to qBittorrent that is behind gluetun VPN

I’ve tried my best to find the answer to this but I just haven’t found anything.

I’m running qbittorrent (compose file) behind gluetun (compose file) with mullvad VPN. I had Sonarr running behind gluetun as well before but I’ve found that it is not best practice and it also makes things more difficult as I add more things to my stack (mainly Jellyseerr).

After moving Sonarr (compose file) it cannot connect to qbittorrent anymore. I’ve tried adding it with “localhost”, “127.0.0.1” and the servers ip-address but nothing is working. How do I connect it properly?

This always works for me, it’s a Synology setup but I think the process is the same

https://drfrankenstein.co.uk/2023/04/23/qbittorrent-with-gluetun-vpn-in-docker-on-a-synology-nas-2/

Hi /u/HighestPie -

There are many resources available to help you troubleshoot and help the community help you.
Please review this comment and you can likely have your problem solved without needing to wait for a human.

Most troubleshooting questions require debug or trace logs.
In all instances where you are providing logs please ensure you followed the Gathering Logs wiki article to ensure your logs are what are needed for troubleshooting.

Logs should be provided via the methods prescribed in the wiki article. Note that Info logs are rarely helpful for troubleshooting.

Dozens of common questions & issues and their answers can be found on our FAQ.

Please review our troubleshooting guides that lead you through how to troubleshoot and note various common problems.

If you’re still stuck you’ll have useful debug or trace logs and screenshots to share with the humans who will arrive soon.
Those humans will likely ask you for the exact same thing this comment is asking…

Once your question/problem is solved, please comment anywhere in the thread saying ‘!solved’ to change the flair to solved.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

172.17.0.#:8080

Where # is your qbit gluetun container.

You have the use the internal dicker network ip address with this setup. Ie you have to use the ip address of the glutun container. A better way however is to just type the name of the sonarr service as docker has an internal DNS server.

I’m your compose you named it ‘glutun’ so just put that in the host/ip address field and then make sure to put the correct port for qbit.

What do you mean? How would I find #?

Ah, yeap thats it. You put me on the right track. Sonarr needs to be connected to the same docker network as gluetun and use the ip-address of the gluetun-container on that network OR just “gluetun”.

Edit: I created a new docker network and then provided it to all my containers in their docker compose files, example: https://pastebin.com/Ycdj3mCqThe name could be anything but I just used something related to gluetun

Edit2: Seems like that created a new problem. Now qbittorrent can’t download anything lol. I’ll do more research on that and get back.

Edit3: I forgot the most important part about computers. Just restart the thing and it will work.

sudo docker exec −it <container-name> ip addr | grep global

I can’t see your file on mobile, but qbt must not have an IP. It’s network is basically gluetun. When you are accessing qbt from other service in the same network, you use gluetun’s IP.

Thanks so much for posting your compose files

Do you mind posting the final compose files for sonarr and gluet, that got it working for you?

Thank you!

Absolutely! Here are the files I am currently using!

Sonarr: https://pastebin.com/wdNwbQXM

Gluetun: https://pastebin.com/cvUUB3PW

Legend, thanks very much, appreciate the share!

You’re welcome, happy I could help!