NordVPN Docker Container (Windows Edition)

This guide shows you how to run NordVPN in Docker and force other containers to use it for all their internet traffic.

This is the correct method for Windows using Docker Desktop. If you need the MacOS version of this, click here.

If you’re using Windows 10/11 + Docker Desktop (WSL2 backend), the cleanest way to run NordVPN in Docker is to:

  1. Run a VPN gateway container (Gluetun)
  2. Attach other containers to the VPN gateway using network_mode: "service:gluetun"
  3. Publish ports on the VPN container, not the app containers

This keeps your Windows host untouched while forcing selected containers to use the VPN.

Click to download the ZIP of the Docker files

Click For Special NordVPN Deal


Prerequisites (Windows)

  • Docker Desktop installed
  • WSL2 backend enabled in Docker Desktop
    • Docker Desktop → Settings → General → ✅ “Use the WSL 2 based engine”
  • A NordVPN account (username + password)

Note: NordVPN has multiple login methods across apps. For Gluetun, you’ll typically use your NordVPN service credentials (not necessarily the same as your Nord account login in the GUI app). If your regular login fails, check Nord’s dashboard for “service credentials.”

NordVPN Service Credentials

If you’re running NordVPN in Docker (or using OpenVPN/WireGuard manually), you do NOT use your email + password.

You must use Nord’s Service Credentials.

These are separate, special credentials designed specifically for:

  • OpenVPN
  • WireGuard / NordLynx
  • Routers
  • Docker containers
  • Manual setups

Step 1 – Log Into Your Nord Account

Go to:

https://my.nordaccount.com

Log in with your normal Nord email + password.


Step 2 – Go to “Set Up NordVPN Manually”

Once logged in:

  1. Click NordVPN
  2. Click Set up NordVPN manually

You are now on the page that shows Service credentials.


Step 3 – Copy Your Service Username & Password

You will see two fields:

  • Username (looks like random letters/numbers, not your email)
  • Password (random string)

These are your service credentials.

👉 Copy both of them.
👉 These are what Docker / OpenVPN will use.

Do NOT use:

  • your email
  • your Nord website password

They will not work.


Step 4 – Paste Them Into Your .env File

Open the .env file in the starter pack and paste:

OPENVPN_USER=PASTE_SERVICE_USERNAME_HERE
OPENVPN_PASSWORD=PASTE_SERVICE_PASSWORD_HERE

Example:

OPENVPN_USER=ab123456
OPENVPN_PASSWORD=9xY#Lk2Pq!

Save the file.

🛑 DON’T MISS THIS DEAL
Your government, Internet Service Provider, app/addon/IPTV developers, and all websites document and record your online activity through your identifying IP address.
Your Current Identifying IP Address (digital fingerprint): 57.141.0.20
Browse anonymously by using NordVPN
TODAY’S DEAL
SAVE 72% ON NORDVPN + 3 FREE MONTHS
NordVPN backs their service with a 30-day money-back guarantee
Use your account on 10 devices with blazing fast speeds & thousands of servers
CLAIM NORDVPN DISCOUNT


Step 1: Create a project folder

Example:

  • C:\docker\nordvpn-stack\

Inside it, you’ll create:

  • docker-compose.yml

  • (optional) qb\config\ and qb\downloads\ folders if you use the example app


Step 2: Create docker-compose.yml

Here’s a working baseline using Gluetun + qBittorrent (as an example protected app).

version: "3.8"

services:
gluetun:
image: qmcgaw/gluetun:latest
container_name: gluetun
cap_add:
NET_ADMIN
environment:
VPN_SERVICE_PROVIDER=nordvpn
VPN_TYPE=openvpn
OPENVPN_USER=YOUR_NORDVPN_SERVICE_USERNAME
OPENVPN_PASSWORD=YOUR_NORDVPN_SERVICE_PASSWORD
SERVER_COUNTRIES=United States
TZ=America/New_York
ports:
# Expose app ports HERE (because apps share gluetun’s network)
“8080:8080” # qBittorrent Web UI example
restart: unless-stopped

qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
network_mode: “service:gluetun”
environment:
TZ=America/New_York
WEBUI_PORT=8080
volumes:
./qb/config:/config
./qb/downloads:/downloads
depends_on:
gluetun
restart: unless-stopped

What to edit

Replace:

  • OPENVPN_USER=...

  • OPENVPN_PASSWORD=...

Optional:

  • Change SERVER_COUNTRIES to your preferred region (or another country)


Step 3: Start it on Windows

Open PowerShell in the folder where your compose file lives:

docker compose up -d

Then watch the VPN connection logs:

docker logs gluetun -f

You’re looking for output indicating it successfully connected and set routes.


Step 4: Confirm the VPN is actually working

Run:

docker exec -it gluetun sh

Then inside the container:

wget -qO- ifconfig.me

The IP returned should be a VPN IP, not your normal home/office IP.

Because qbittorrent is sharing Gluetun’s network stack, it will use the same public IP.


Step 5: Access your app (example)

Because ports are published on Gluetun, you’ll access qBittorrent at:

  • http://localhost:8080

(or http://<your-pc-ip>:8080 from another device on your LAN)


Step 6: Add more containers behind the VPN

Any container you want routed through NordVPN just needs:

network_mode: "service:gluetun"
depends_on:
- gluetun

And if that container has a UI/API port, publish it on the gluetun service under ports:.


Common gotchas on Windows

  • Do not publish ports on the protected container when using network_mode: "service:gluetun"
    Publish ports on gluetun instead.

  • If Gluetun can’t authenticate, you’re probably using the wrong Nord credentials. Look for Nord “service credentials.”

  • Windows pathing: the ./qb/... volumes are relative to the compose folder, which is easiest on Windows.