Note:
PIA's Legacy VPN Network will no longer be available after 31st Oct 2020.
The latest docker build now supports PIA's NextGen VPN network. Wireguard is currently NOT supported, but will be as soon as it is available in the Alpine Linux repositories.
Read the PIA Legacy VPN Network Sunset Announcement for more info.
An Alpine Linux container running Privoxy and OpenVPN via Private Internet Access
Protect your browsing activities through an encrypted and anonymized VPN proxy!
You will need a PrivateInternetAccess account. If you don't have one, you can sign up here for one.
docker run -d \
--cap-add=NET_ADMIN \
--device=/dev/net/tun \
--name=vpn_proxy \
--dns=209.222.18.218 --dns=209.222.18.222 \
--restart=always \
-e "REGION=<region>" \
-e "USERNAME=<pia_username>" \
-e "PASSWORD=<pia_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/data>:/config \
-p 8118:8118 \
act28/pia-openvpn-proxy
Substitute the environment variables for REGION
, USERNAME
, PASSWORD
, LOCAL_NETWORK
, UID
, GID
as indicated.
NOTE UID/GID refer to the user id and group id on your host machine. You can use id -u <your username>
to find your UID. And id -g <your username>
to find your GID.
A docker-compose-dist.yml
file has also been provided. Copy this file to docker-compose.yml
and substitute the environment variables are indicated.
Then start the VPN Proxy via:
docker-compose up -d
REGION
is optional. The default region is set to Switzerland
. REGION
should match the supported PIA .opvn
region config.
See the PIA VPN Tunnel Network page for details.
Use the Location
value for your REGION
.
USERNAME
/ PASSWORD
- Credentials to connect to PIA (different from your PIA customer login!)
LOCAL_NETWORK
- The CIDR mask of the local IP addresses (e.g. 192.168.1.0/24, 10.1.1.0/24) which will be accessing the proxy. This is so the response to a request can be returned to the client (i.e. your browser).
UID
/ GID
- Your UID/GID on your host machine.
MASQUERADE
- set to "true" to add masquerade rule for tun0 and use container as a router
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 Proxy SwitchyOmega extension/addon as a convenience.