How to set up an OpenVPN manual connection to NordVPN with Gluetun?

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

  1. Log in to your Nord Account.
  2. Click NordVPN, then scroll down to Advanced Settings (Manual setup) and click Set up NordVPN manually.
  3. You will receive a verification code in the email you use for NordVPN. Enter the code to confirm.
  4. 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=nordvpn
  • VPN_TYPE=openvpn
  • OPENVPN_USER - your service credentials username
  • OPENVPN_PASSWORD - your service credentials password
  • OPENVPN_PROTOCOL - optional, udp (default) or tcp

Optional server-selection variables include SERVER_COUNTRIESSERVER_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-stopped

Replace 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

  1. Start the container:
  2. docker compose up -d
  3. Check the logs to confirm the tunnel came up:
  4. docker logs -f gluetun
  5. Confirm your traffic exits through NordVPN by running an IP check from inside the container's network namespace:
  6. 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:
      - gluetun

Additional 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 udp protocol is blocked on restrictive networks, switch to OPENVPN_PROTOCOL=tcp and 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.)
Was this article helpful?

Still having issues?

  • Live chat

  • Email form

By clicking “Chat with support”, you agree to our Terms of Service and acknowledge our Privacy Policy. Chat functionality relies on cookies. By starting the chat, you agree to their use. Learn more in our Cookie Policy.