Want faster VPN speeds and quicker connection times? It’s time to switch from OpenVPN to WireGuard! This guide will walk you through updating your Gluetun configuration to use WireGuard β with a focus on ProtonVPN.
β Why switch? WireGuard is a modern VPN protocol thatβs faster, more efficient, and easier to configure than OpenVPN.
ProtonVPN makes it easy to use WireGuard with Gluetun. Here’s how to update your configuration.
.conf
filePrivateKey
It will look something like this:
PrivateKey = wOEI9rqqbDwnN8/Bpp22sVz48T71vJ4fYmFWujulwUU=
.env
File π οΈOpen your .env
file and remove the OpenVPN credentials:
nano /opt/yams/.env
Remove or comment out:
VPN_USER=your-username
VPN_PASSWORD=your-password
You can also remove VPN_SERVICE=protonvpn
if you want to hardcode it in the compose file (see below), or leave it β both work.
π‘ Not sure how the
.env
file works? Check out our Environment File Guide to learn how to manage variables likeWIREGUARD_PRIVATE_KEY
securely.
docker-compose.yaml
π³Find the gluetun
service and replace the environment:
section with the following:
environment:
- VPN_SERVICE_PROVIDER=protonvpn
- VPN_TYPE=wireguard
- WIREGUARD_PRIVATE_KEY=wOEI9rqqbDwnN8/Bpp22sVz48T71vJ4fYmFWujulwUU=
- VPN_PORT_FORWARDING=on
- VPN_PORT_FORWARDING_PROVIDER=protonvpn
- PORT_FORWARD_ONLY=on
π§ Tip: You can still use
${VARIABLE}
syntax if you prefer to keep the private key in your.env
file. See the Environment File Guide for more info.
Apply the changes:
yams restart
Run the VPN check:
yams check-vpn
You should see your qBittorrent IP is different from your local IP β and located in the country you selected in ProtonVPN.
You can also check the Gluetun logs:
docker logs gluetun
Look for lines like:
Using VPN provider: protonvpn
VPN type: wireguard
Port forwarding is enabled
WireGuard support varies by provider. Hereβs what to do:
gluetun
environment variables in your docker-compose.yaml
accordinglyβ οΈ Not all providers support WireGuard or port forwarding. Check their documentation carefully.
WIREGUARD_PRIVATE_KEY
VPN_TYPE=wireguard
is setdocker-compose.yaml
VPN_PORT_FORWARDING=on
and PORT_FORWARD_ONLY=on
are setIf you’re stuck: