Need more lightweight Alternative to gluetun to bypass geographic restrictions of the Docker container reddit / selfhosted ---------------------------------------------------------------------- tys203831 · 2023-12-05 16:04 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: [h ttps://developers.generativeai.google/available\_regions](https://deve lopers.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. ---------------------------------------------------------------------- geo38 · 2023-12-05 18:16 https://github.com/tprasadtp/protonvpn-docker ---------------------------------------------------------------------- tys203831 · 2023-12-06 01:09 Thanks a lot, what is the ram usage of this VPN? ---------------------------------------------------------------------- geo38 · 2023-12-06 01:11 Too much. ---------------------------------------------------------------------- retrodaredevil · 2023-12-06 03:24 Does anyone know why gluetun would take up so much ram? Asking because I was likely going to set it up at some point, specifically because I know it has killswitch functionality built in ---------------------------------------------------------------------- tankerkiller125real · 2023-12-07 01:02 VPNs always reserve a decent amount of RAM. They have to decrypt streams of data, while also trying to maintain Internet speeds as high as possible. Part of the solution is to have a decent amount of buffer space to hold stuff while the CPU works through it. This usually works really well (for general Internet browsing it stuff) and does help with large file downloads, but does breakdown after a while depending on your CPU performance. ---------------------------------------------------------------------- tys203831 · 2023-12-07 13:19 Ah, I see. Now I see the logic of why it consumes a lot of RAM. So, besides VPN, is there any other way to bypass the geographic location of my docker container service? I'm not sure if proxy server could achieve it, if better, in a less RAM usage. ---------------------------------------------------------------------- retrodaredevil · 2023-12-08 20:56 Some services allow you to specify a proxy in their config. If the service you want to use inside your docker container supports this, you might consider using a proxy. I would recommend looking into SOCKS proxies. You could consider trying to limit the amount of available memory to a docker container and see if its performance is still acceptable. Another thing that might be worth looking into is the memory usage of a WireGuard client versus an openvpn client. I don't know if there's a big difference, but it would be worth looking at. ---------------------------------------------------------------------- tys203831 · 2023-12-08 21:11 I see, it seems like what I am looking at. I am using n8n for your info, and I self-hosted it in a docker container via Docker Compose file. Just wanna ask if SOCKS proxies could be implemented via Docker Compose? Any Docker Compose example file? Thanks a lot, as this gives me an idea to solve my problem. ---------------------------------------------------------------------- retrodaredevil · 2023-12-08 23:10 There are many different applications that can provide a SOCKS proxy including many VPN containers (including gluetun). However if your goal is minimal RAM usage, it might be worth having the SOCKS proxy hosted on another computer with more RAM (since you are worried about RAM usage). One of the easiest ways to setup a SOCKS proxy is using the -D flag of the ssh command. You could set up a docker container to run an ssh command and provide you a SOCKS proxy. (I assume this is lighter weight than a VPN, but I haven't measured RAM usage). Some VPN providers might provide a SOCKS proxy with authentication, but I don't know any off the top of my head. Personally I would probably just limit the RAM usage of your VPN container and see if it still works as you expect it to: [https://docs.docker.com/compose/compose- file/deploy/#resources](https://docs.docker.com/compose/compose- file/deploy/#resources) ---------------------------------------------------------------------- tys203831 · 2023-12-09 00:09 I tried it before, the website is very slow, and if I reduce the ram to a certain point e.g., from 300mb ram to 100mb ram, the website becomes 503 error ---------------------------------------------------------------------- craxkerjack86 · 2023-12-12 15:22 This is my config, managed to lower it to 40-60mb/instance version: "3" services: gluetun: image: qmcgaw/gluetun container\_name: jp\_1 cap\_add: \- NET\_ADMIN ports: \- 5030:8888/tcp # HTTP proxy environment: \- VPN\_SERVICE\_PROVIDER=ipvanish \- OPENVPN\_USER=${USERNAME} \- OPENVPN\_PASSWORD=${PASSWORD} \- SERVER\_HOSTNAMES=nrt-a01.ipvanish.com \- HTTPPROXY=on \- HTTPPROXY\_STEALTH=on \- BLOCK\_MALICIOUS=off \- BLOCK\_SURVEILLANCE=off \- BLOCK\_ADS=off \- DOT=off ---------------------------------------------------------------------- craxkerjack86 · 2023-12-12 15:30 I managed to lower mine to 40-60mb ​ version: "3" services: jp_1: image: qmcgaw/gluetun container_name: jp_1 cap_add: - NET_ADMIN ports: - 5030:8888/tcp # HTTP proxy environment: - VPN_SERVICE_PROVIDER=ipvanish - OPENVPN_USER=${USERNAME} - OPENVPN_PASSWORD=${PASSWORD} - SERVER_HOSTNAMES=nrt-a01.ipvanish.com - HTTPPROXY=on - HTTPPROXY_STEALTH=on - BLOCK_MALICIOUS=off - BLOCK_SURVEILLANCE=off - BLOCK_ADS=off - DOT=off The last 4 lines are the crucial ones ---------------------------------------------------------------------- tys203831 · 2023-12-12 16:19 Great thanks, it works perfectly. You're my savior 😂