Introduction
In this article, you will learn how to configure a NordVPN OpenVPN manual connection inside a Gluetun Docker container. Gluetun is a lightweight VPN client container that routes the traffic of your other Docker containers through NordVPN over OpenVPN. The key step that trips most people up is authentication: NordVPN no longer accepts your email and password for third-party apps, so you must use service credentials instead.
Before you start
- A working Docker (and optionally Docker Compose) installation.
- Your NordVPN service credentials (username and password) - these are NOT your Nord Account email and password.
- The NordVPN OpenVPN server location(s) you want to connect to (country, region, or city).
Here's what to do
Step 1: Obtain your service credentials
- Log in to your Nord Account.
- Click NordVPN, then scroll down to Advanced Settings (Manual setup) and click Set up NordVPN manually.
- You will receive a verification code in the email you use for NordVPN. Enter the code to confirm.
- Open the Service credentials tab. Copy the Username and Password shown there - these are the values Gluetun needs.
NOTE: Service credentials are different from your regular Nord Account login. If your connection fails authentication later, double-check if you copied the correct service credentials.
Step 2: Create the Gluetun configuration
In Gluetun, NordVPN over OpenVPN uses these environment variables:
VPN_SERVICE_PROVIDER=nordvpnVPN_TYPE=openvpn-
OPENVPN_USER- your service credentials username -
OPENVPN_PASSWORD- your service credentials password -
OPENVPN_PROTOCOL- optional,udp(default) ortcp
Optional server-selection variables include SERVER_COUNTRIES, SERVER_REGIONS, and SERVER_CITIES (comma-separated lists).
Step 3: Run with Docker Compose
Create a docker-compose.yml file like the following:
services:
gluetun:
image: qmcgaw/gluetun
container_name: gluetun
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun:/dev/net/tun
ports:
- 8000:8000 # Gluetun control server (optional)
environment:
- VPN_SERVICE_PROVIDER=nordvpn
- VPN_TYPE=openvpn
- OPENVPN_USER=YOUR_SERVICE_USERNAME
- OPENVPN_PASSWORD=YOUR_SERVICE_PASSWORD
- OPENVPN_PROTOCOL=udp
- SERVER_COUNTRIES=United States
restart: unless-stoppedReplace YOUR_SERVICE_USERNAME and YOUR_SERVICE_PASSWORD with the service credentials from Step 1, and adjust SERVER_COUNTRIES to your preferred location.
Step 4: Start and verify the connection
- Start the container:
- Check the logs to confirm the tunnel came up:
- Confirm your traffic exits through NordVPN by running an IP check from inside the container's network namespace:
docker compose up -d
docker logs -f gluetun
docker exec gluetun wget -qO- https://ipinfo.io/ip
The returned IP should be a NordVPN server IP, not your real one.
Step 5: Route other containers through Gluetun
To send another container's traffic through the tunnel, set that container to share Gluetun's network and remove its own ports (publish them on the Gluetun service instead):
yourapp:
image: your/app-image
network_mode: "service:gluetun"
depends_on:
- gluetunAdditional tips
- If you see an "AUTH_FAILED / Your credentials might be wrong" error, you are almost certainly using your Nord Account email and password instead of the service credentials. Re-copy them from the Service credentials tab.
- If the default
udpprotocol is blocked on restrictive networks, switch toOPENVPN_PROTOCOL=tcpand recreate the container. - Gluetun includes a built-in killswitch, so dependent containers lose internet access if the VPN drops, preventing IP leaks. (Based on Gluetun's documented default behavior; verify in the current wiki for your version.)