Gluetun (VPN for a few containers) Alternative?

Gluetun sets out to be exactly what I need, a simple method to route a few docker containers (for which there is not a version of the container that includes a VPN) through a wireguard VPN and still allow local hosts to access. However, I find that with my config (which certainly could be improved), Gluetun bounces at least weekly. When it does, the containers that use it have to be restarted.

So what other relatively easy solutions are there to try that may work more reliably?

I just use a Cron job to restart gluetun and other linked containers everyday at midnight. Never had any problems…

I found gluetun (setup with protonvpn via Docker Compose) took quite a lot of memory around 300 MB RAM, and that’s why I wish to find a more lightweight solution.

The only reason I used this VPN is to bypass geographic restrictions for one of my docker containers to use the Google Palm API service: https://developers.generativeai.google/available_regions

(Info: My hosting has only 1.5 GB RAM)

So, I hope for more suggestions for my case. e.g., change the docker proxy. Many thanks.

Do you mind sharing this cron job?

u/JMOhare, any idea how to route a container through that? I tried adding to the compose for the privoxyvpn container:

environment:

- VPN_INPUT_PORTS=3100,3101

ports:

- 3100:3000

- 3101:3001

And modified a test webtop (linuxserver/webtop) to add a new network_mode and remove its ports.

network_mode: ‘container:arch-privoxyvpn’

# ports:

# - 3100:3000

# - 3101:3001

But no access to that container.

Same thing around here, using Gluetun took ~360MB of RAM, I migrated to arch-privoxyvpn and it took only ~30 MB.

Sure, I am using yams script, and have added a short code block for convenience-

10   22    *    *    *   /usr/local/bin/yams vpn-reset

code block-

if [ $option == "vpn-reset" ]; then
$dc rm -svf qbittorrent
$dc rm -svf gluetun
$dc up -d gluetun
$dc up -d qbittorrent
exit 0

fi

$dc is just the full docker-compose command.

I followed this tutorial https://www.youtube.com/watch?v=znSu_FuKFW0 to get it running on Unraid :+1: some of the steps may be different for you since you are doing it in bare docker-compose, but the Unraid template maps up to a docker run command.

Though this video does not cover the credentials part. Privoxy is VERY strict with the connections, so if you have not configured the VPN correctly (by placing the right openvpn credentials file in the right folder) then it will just not work. Double check the logs for that container.

Don’t know if I can help without more info. Perhaps one of these links can help?

Thanks for the comment. It sounds interesting. Btw, here is how I managed to decrease ram usage to 80mb: https://www.reddit.com/r/selfhosted/comments/18bfb1n/need_more_lightweight_alternative_to_gluetun_to/… But, I turn off some services offered by gluetun