# OpenVPN
docker run -it --rm --cap-add=NET_ADMIN -e VPN_SERVICE_PROVIDER=mullvad \
-e VPN_TYPE=openvpn -e OPENVPN_USER=1355131650462193 \
-e SERVER_CITIES=amsterdam qmcgaw/gluetun
# Wireguard
docker run -it --rm --cap-add=NET_ADMIN -e VPN_SERVICE_PROVIDER=mullvad \
-e VPN_TYPE=wireguard \
-e WIREGUARD_PRIVATE_KEY=wOEI9rqqbDwnN8/Bpp22sVz48T71vJ4fYmFWujulwUU= \
-e WIREGUARD_ADDRESSES="10.64.222.21/32" \
-e SERVER_CITIES=amsterdam qmcgaw/gluetun
version: "3"
services:
gluetun:
image: qmcgaw/gluetun
cap_add:
- NET_ADMIN
environment:
- VPN_SERVICE_PROVIDER=mullvad
- VPN_TYPE=wireguard
- WIREGUARD_PRIVATE_KEY=wOEI9rqqbDwnN8/Bpp22sVz48T71vJ4fYmFWujulwUU=
- WIREGUARD_ADDRESSES=10.64.222.21/32
- SERVER_CITIES=Amsterdam
VPN_SERVICE_PROVIDER=mullvad
OPENVPN_USER
which is your Mullvad user ID.
WIREGUARD_PRIVATE_KEY
is your 32 bytes key in base64 format. The private key can only be obtained by generating a Wireguard configuration file. TheWireguard Key
displayed on the Manage devices and ports page on Mullvad is not the private key that is required. Generate a Wireguard configuration file, download the zip file, extract any of the.json
files within and use thePrivateKey
value. Note this value is the same for all Mullvad servers. 💁 Screenshots on how to obtain it.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. Note this is the same value for all Mullvad servers and for your private key. 💁 Screenshots on how to obtain it.
SERVER_COUNTRIES
: Comma separated list of countriesSERVER_CITIES
: Comma separated list of citiesSERVER_HOSTNAMES
: Comma separated list of server hostnamesISP
: Comma separated list of ISPsOWNED_ONLY
: If the VPN server is owned by Mullvad. It defaults tono
, meaning it includes all servers. It can be set toyes
.VPN_ENDPOINT_PORT
: custom server endpoint port to use- For OpenVPN:
- TCP: it can only be
80
,443
or1401
- UDP: it can only be
53
,1194
,1195
,1196
,1197
,1300
,1301
,1302
,1303
or1400
- It defaults to
443
for TCP and1194
for UDP
- TCP: it can only be
- For Wireguard: it can be any value and defaults to
51820
- For OpenVPN:
Mullvad supports IPv6 addresseses for their OpenVPN servers, and these should automatically be used at random if your container setup has IPv6 enabled. See the IPv6 documentation for more information.
To see a list of servers available, list the VPN servers with Gluetun.