Private Internet Access
April 19, 2026 ยท View on GitHub
OpenVPN
docker run -it --rm --cap-add=NET_ADMIN --device /dev/net/tun \
-e VPN_SERVICE_PROVIDER="private internet access" \
-e OPENVPN_USER=abc -e OPENVPN_PASSWORD=abc \
-v /yourpath/gluetun:/gluetun \
-e SERVER_REGIONS=Netherlands qmcgaw/gluetun
version: "3"
services:
gluetun:
image: qmcgaw/gluetun
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun:/dev/net/tun
volumes:
- ./gluetun:/gluetun
environment:
- VPN_SERVICE_PROVIDER=private internet access
- OPENVPN_USER=abc
- OPENVPN_PASSWORD=abc
- SERVER_REGIONS=Netherlands
Required environment variables
VPN_SERVICE_PROVIDER=private internet accessOPENVPN_USEROPENVPN_PASSWORD
Optional environment variables
SERVER_REGIONS: Comma separated list of regionsSERVER_NAMES: Comma separated list of server namesSERVER_HOSTNAMES: Comma separated list of server hostnames. Beware this is the narrowest filter, so if you set this to a single hostname and this hostname disappears from the Gluetun servers data due to an update, your container will no longer work until this filter is changed. I would suggest avoiding it unless you know this reliability risk.PORT_FORWARD_ONLY: Set totrueto select servers with port forwarding onlyPRIVATE_INTERNET_ACCESS_OPENVPN_ENCRYPTION_PRESET: Encryption preset, defaulting tostrong, which can be set tonormalorstrong.OPENVPN_ENDPOINT_PORT: Custom OpenVPN server endpoint portVPN_PORT_FORWARDING: defaults tooffand can be set toonto enable port forwarding on the VPN serverOPENVPN_PROTOCOL:udportcp, defaults toudp
Wireguard
๐ For now, native support cannot be added, but this is a slow work in progress.
In the meantime, @Kieros proposes to use kylegrantlucas/pia-wg-config to extract a Wireguard configuration file which you can then use with the custom provider.
For VPN server port fowarding with Wireguard, you need to set:
VPN_PORT_FORWARDING=onVPN_PORT_FORWARDING_PROVIDER=private internet accessVPN_PORT_FORWARDING_USERNAME=yourusernameVPN_PORT_FORWARDING_PASSWORD=yourpasswordSERVER_NAMES=the-tls-server-namefor examplepanama408
VPN server port forwarding
Warning
In my experience, port forwarding with PIA is not really working for some reason. It seems to only work for p2p applications, PIA might be doing deep packet inspection on the forwarded port.
From @ddelange on issue #464, further confirming this:
PIA replied that their service does not support incoming connections over a forwarded port. I also don't understand the answer (I was asking specifically about hosting a webserver on the forwarded port), because incoming connections on the forwarded port seem to work fine e.g. for P2P protocols
Setup
First refer to the VPN server port forwarding setup page.
Once enabled, you will keep the same forwarded port for 60 days as long as you bind mount the /gluetun directory. It will be automatically refreshed.
Deluge
@jawilson developed a plugin to automagically update the forwarded port in Deluge: deluge-piaportplugin
Servers
To see a list of servers available, list the VPN servers with Gluetun.