This project sets up a Squid proxy server that routes traffic through an OpenVPN client. It allows you to route your traffic through a VPN for added privacy and security.
- Docker
- Docker Compose
- An OpenVPN configuration file (
client.ovpn) should be in the$project_root/localdirectory.
-
Place your OpenVPN configuration file (
client.ovpn) in the$project_root/localdirectory. Note: TheCONFIG_FILEenvironment variable specifies the OpenVPN configuration file to use (e.g.,client.ovpn). If this variable is not set, the container will automatically select a random.confor.ovpnfile from the/configdirectory using the following command:config_file=$(find /config -name '*.conf' -o -name '*.ovpn' 2> /dev/null | sort | shuf -n 1)To unser this variable edit the docker-compose.yaml
-
Build and start the services:
docker compose build docker compose up -d
- Set your proxy settings to
http://localhost:3128. - Verify the proxy is working:
curl --proxy http://localhost:3128 http://ifconfig.co
- Check the logs for the OpenVPN client and Squid:
docker logs openvpn-client docker logs squid
use flag -f to monitor logs like this docker logs -f openvpn-client
- Ensure DNS resolution works inside the OpenVPN container:
docker exec -it openvpn-client ping ifconfig.co
To stop the services, run:
sh docker compose down