An Alpine Linux container running Privoxy and OpenVPN via Private Internet Access
100K+
An Alpine Linux container running Privoxy and OpenVPN/WireGuard via Private Internet Access
Announcements:
- 2026-04-13 added socks5 tcp/udp proxy, switched ovpn to use udp + aes-256-gcm, security hardening
- 2025-12-08 added linux/arm/v7 image support
- 2024-03-18 added linux/arm64 image support
- 2024-03-07 added wireguard support
docker rundocker run -d \
--cap-add=MKNOD \
--cap-add=NET_ADMIN \
--cap-add=NET_RAW \
--device=/dev/net/tun \
--name=vpn_proxy \
--dns=209.222.18.218 --dns=209.222.18.222 \
--restart=always \
-e "VPN_PROTOCOL=openvpn" \
-e "REGION=switzerland" \
-e "USERNAME=${USERNAME}" \
-e "PASSWORD=${PASSWORD}" \
-e "LOCAL_NETWORK=192.168.1.0/24" \
-e "UID=1000" \
-e "GID=1000" \
-v /etc/localtime:/etc/localtime:ro \
-v </host/path/to/config>:/config \
-p 8118:8118 \
-p 1080:1080 \
docker.io/act28/pia-openvpn-proxy
docker run -d \
--cap-add=NET_ADMIN \
--cap-add=NET_RAW \
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
--privileged=true \
--name=vpn_proxy \
--dns=209.222.18.218 --dns=209.222.18.222 \
--restart=always \
-e "VPN_PROTOCOL=wireguard" \
-e "REGION=swiss" \
-e "USERNAME=${USERNAME}" \
-e "PASSWORD=${PASSWORD}" \
-e "LOCAL_NETWORK=192.168.1.0/24" \
-e "UID=1000" \
-e "GID=1000" \
-v /etc/localtime:/etc/localtime:ro \
-v </host/path/to/config>:/config \
-p 8118:8118 \
-p 1080:1080 \
docker.io/act28/pia-openvpn-proxy
NOTE
Substitute the environment variables for VPN_PROTOCOL, REGION, USERNAME,
PASSWORD, LOCAL_NETWORK, UID, GID as indicated.
docker-composeAn example docker-compose-dist.yml file has been provided. Copy/rename this
file to docker-compose.yml and substitute the environment variables as
indicated.
Then start the VPN Proxy via:
docker-compose up -d
| Variable Name | Description |
|---|---|
VPN_PROTOCOL | wireguard or openvpn (Default: openvpn) |
REGION | Default (OpenVPN): switzerland. See Wireguard section below for more information. |
USERNAME | Your PIA Username |
PASSWORD | Your PIA Password |
LOCAL_NETWORK | The CIDR mask of your local IP addresses (e.g. 192.168.1.0/24, |
| 10.1.1.0/24). | |
UID | Use id -u $USER to find your UID |
GID | Use id -g $USER to find your GID. |
PIA's wireguard uses a JSON API request over HTTPS to configure and setup the
tunnel connection. You will have to search through the returned JSON
data to find the id key of your preferred region.
You can find the current region list here.
The open-source PIA manual-connection script uses a latency check to determine the "best" region, which may not be ideal, in certain circumstances. I have chosen not to include a latency check at this time, but may consider it in another iteration.
To connect to the VPN Proxy, set your browser proxy to 127.0.0.1:8118 (or
0.0.0.0:8118 if that does not work). If you override the docker port -p, make
sure to use that port number instead.
Alternatively, you can use the ZeroOmega extension/addon as a convenience.
Proxy SwitchyOmega 3 (ZeroOmega) for Chrome
ZeroOmega--Proxy SwitchyOmega V3 for FireFox
A SOCKS5 proxy has been provided to support tcp/udp routing through the VPN tunnel. Use 127.0.0.1:1080 (or 0.0.0.0:1080)
Content type
Image
Digest
sha256:0255b093b…
Size
10.8 MB
Last updated
3 months ago
docker pull act28/pia-openvpn-proxy