# OpenVPN
docker run -it --rm --cap-add=NET_ADMIN -e VPN_SERVICE_PROVIDER=surfshark \
-e OPENVPN_USER=abc -e OPENVPN_PASSWORD=abc \
-e SERVER_COUNTRIES=Netherlands qmcgaw/gluetun
# Wireguard
docker run -it --rm --cap-add=NET_ADMIN -e VPN_SERVICE_PROVIDER=surfshark \
-e VPN_TYPE=wireguard \
-e WIREGUARD_PRIVATE_KEY=wOEI9rqqbDwnN8/Bpp22sVz48T71vJ4fYmFWujulwUU= \
-e WIREGUARD_ADDRESSES="10.64.222.21/16" \
-e SERVER_COUNTRIES=Netherlands qmcgaw/gluetun
version: "3"
services:
gluetun:
image: qmcgaw/gluetun
cap_add:
- NET_ADMIN
environment:
- VPN_SERVICE_PROVIDER=surfshark
- VPN_TYPE=wireguard
- WIREGUARD_PRIVATE_KEY=wOEI9rqqbDwnN8/Bpp22sVz48T71vJ4fYmFWujulwUU=
- WIREGUARD_ADDRESSES=10.64.222.21/16
- SERVER_COUNTRIES=Netherlands
VPN_SERVICE_PROVIDER=surfshark
OPENVPN_USER
OPENVPN_PASSWORD
WIREGUARD_PRIVATE_KEY
is your 32 bytes key in base64 format. The private key can only be registered (and eventually generated) with these steps:- Log into your Surfshark account
- Select VPN from the left menu
- Select Manual Setup
- Select Deskop or mobile
- Select WireGuard
- Select I don't have a keypair and enter a name for the key
- Select Generate a new keypair
- Use the Private key value for the
WIREGUARD_PRIVATE_KEY
environment variable - Next select a location and download the config file (Ignore the information on screen as it will not work with GlueTUN)
- Within the config file obtain the IP on the
Address
line this is used for theWIREGUARD_ADDRESSES
to connect.
WIREGUARD_ADDRESSES
is the Wireguard IP network interface address in CIDR formatxx.xx.xx.xx/xx
. To obtain it, first download a Wireguard configuration file using same steps as forWIREGUARD_PRIVATE_KEY
above. In the configuration file, locate theAddress
value. This one should contain a comma delimited list of an IPv4 and IPv6 address, so use the IPv4 address (usually the first one) as the value for theWIREGUARD_ADDRESSES
environment variable. You can add the IPv6 address if your setup supports IPv6. Note this is the same value for all Surfshark servers and for your private key.
VPN_TYPE
:openvpn
orwireguard
SERVER_COUNTRIES
: Comma separated list of countriesSERVER_REGIONS
: Comma separated list of regionsSERVER_CITIES
: Comma separated list of citiesSERVER_HOSTNAMES
: Comma separated list of server hostnames
To see a list of servers available, list the VPN servers with Gluetun.