Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NordVPN_WireGuard

NordVPN WireGuard Configuration Generation

I. Prerequisites

Get Access Token

  1. Log in to your NordAccount dashboard.
  2. Click on NordVPN in the services list.
  3. Scroll down to the Manual setup section and click Set up NordVPN manually.
  4. Verify your email address by entering the code sent to your email.
  5. Generate a new token in the Access Token tab.
  6. Copy and save this token. You will use it as the ACCESS_TOKEN.

Country Code Format

If you specify a country, use the 2-letter ISO 3166-1 alpha-2 code (e.g., US, DE, GB, JP).

You can use this command to check available countries

curl --silent "https://api.nordvpn.com/v1/servers/countries" | jq --raw-output '.[].name, .[].code'

II. Run with Docker (Recommended)

  1. Build the Docker image:

    docker build -t nordvpn-wireguard .
  2. Run the container: Replace your_token with your actual token. This command mounts the current directory to /output inside the container, so the configuration file is saved to your current folder.

    docker run --rm -v $(pwd):/output -e ACCESS_TOKEN="your_token" -e COUNTRY_CODE="us" nordvpn-wireguard

    Windows (PowerShell):

    docker run --rm -v ${PWD}:/output -e ACCESS_TOKEN="your_token" -e COUNTRY_CODE="us" nordvpn-wireguard

    Windows (Command Prompt):

    docker run --rm -v "%cd%":/output -e ACCESS_TOKEN="your_token" -e COUNTRY_CODE="us" nordvpn-wireguard

III. Run from Source (Python)

  1. Save the code: Save the code as a Python file (e.g., main.py).

  2. Install dependencies: Open your terminal or command prompt and run:

    pip install requests python-dotenv
  3. Create a .env file: Create a file named .env in the same directory as the script and add your configuration:

    ACCESS_TOKEN=your_token
    COUNTRY_CODE=us
    • ACCESS_TOKEN: Use the token obtained in the Prerequisites section.
    • COUNTRY_CODE (optional): Use the 2-letter ISO code (e.g., "US"). If you don't set this, the program will fetch a general recommended server.
  4. Run the program: Execute the Python script:

    python main.py

    It will print the WireGuard configuration to your console and save it to a file (e.g., yyyymmdd-nordvpn-us.conf) in the current directory.

Reference

About

NordVPN WireGuard Configuration Generation

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages