CLI for generating optimized NordVPN WireGuard configurations
10K+
Nordgen is a Go-based command-line tool that generates WireGuard configuration files for NordVPN servers.
The container exchanges a NordVPN access token for a NordLynx private key, downloads the current WireGuard server catalogue, applies the selected filters, and writes the generated configurations to a mounted directory.
The Go container provides the same main commands, configuration options, validation rules, and output structure as the Python package while allowing the application to run in a small container image without a Python runtime.
Access tokens can be created from the Nord Account dashboard.
The generated configurations are written to /data inside the container. Mount a local directory at /data to retain them after the container exits.
mkdir -p generated_configs && docker run -it --rm -u "$(id -u):$(id -g)" -v "$(pwd)/generated_configs:/data" mustafachyi/nordgen:latest
mkdir -p generated_configs && docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd)/generated_configs:/data" mustafachyi/nordgen:latest --token "YOUR_TOKEN" --dns 1.1.1.1 --keepalive 15 --group standard p2p --exclude-dedicated
docker run --rm mustafachyi/nordgen:latest get-key --token "YOUR_TOKEN"
if (!(Test-Path "generated_configs")) { New-Item -ItemType Directory "generated_configs" | Out-Null }; docker run -it --rm -v "${PWD}/generated_configs:/data" mustafachyi/nordgen:latest
if (!(Test-Path "generated_configs")) { New-Item -ItemType Directory "generated_configs" | Out-Null }; docker run --rm -v "${PWD}/generated_configs:/data" mustafachyi/nordgen:latest --token "YOUR_TOKEN" --dns 1.1.1.1 --keepalive 15 --group standard p2p --exclude-dedicated
docker run --rm mustafachyi/nordgen:latest get-key --token "YOUR_TOKEN"
if not exist "generated_configs" mkdir "generated_configs" && docker run -it --rm -v "%cd%/generated_configs:/data" mustafachyi/nordgen:latest
if not exist "generated_configs" mkdir "generated_configs" && docker run --rm -v "%cd%/generated_configs:/data" mustafachyi/nordgen:latest --token "YOUR_TOKEN" --dns 1.1.1.1 --keepalive 15 --group standard p2p --exclude-dedicated
docker run --rm mustafachyi/nordgen:latest get-key --token "YOUR_TOKEN"
| Command | Description |
|---|---|
generate | Generate WireGuard configuration files. This is the default command. |
get-key | Retrieve the NordLynx private key associated with an access token. |
help | Display the command reference. |
The following commands are equivalent:
nordgen [options]
nordgen generate [options]
Display the complete command reference with:
docker run --rm mustafachyi/nordgen:latest help
Options are placed after the image name in the Docker command.
| Flag | Description | Default |
|---|---|---|
-t, --token | NordVPN access token. The application prompts for it when omitted. | Prompted |
-d, --dns | DNS server address written to each configuration. IPv4 and IPv6 are supported. | 103.86.96.100 |
-i, --ip | Use server IP addresses instead of hostnames for WireGuard endpoints. | Disabled |
-k, --keepalive | PersistentKeepalive value in seconds, from 0 through 65535. | 25 |
-g, --group | Include servers belonging to the specified groups. Supported values are standard, p2p, dedicated, onion, and double. | All groups |
-e, --exclude-dedicated | Exclude servers belonging to the dedicated IP group. | Disabled |
The group option can be repeated or followed by multiple values:
docker run --rm -v "$(pwd)/generated_configs:/data" mustafachyi/nordgen:latest --token "YOUR_TOKEN" --group standard p2p
Servers in the dedicated group require an active NordVPN Dedicated IP subscription.
Configuration files can still be generated without that subscription, but connections to those servers may not succeed. Use --exclude-dedicated to omit them.
Each generation creates a timestamped directory under the mounted /data directory.
Example:
generated_configs/
└── nordvpn_configs_20260802_215200_123456789/
├── configs/
│ └── <group_combo>/<country>/<city>/<server_name>.conf
└── best_configs/
└── <group_combo>/<country>/<city>/<server_name>.conf
The two output trees contain:
configs/: One configuration for each unique server hostname that matches the selected filters.best_configs/: One selected server for each group combination, country, and city.Servers are ordered primarily by their reported load. Geographic distance is used to resolve equal-load results when geolocation data is available. If geolocation is unavailable, hostname ordering is used as the fallback.
The access token is used only to request the NordLynx private key and is not written to the generated files.
The generated WireGuard configurations contain the private key and should be treated as sensitive files.
Passing a token with --token may store it in shell history. Interactive mode prompts for the token instead.
Source code is available at:
https://github.com/mustafachyi/NordVPN-WireGuard-Config-Generator
Nordgen is distributed under the GNU General Public License version 3 or later.
Content type
Image
Digest
sha256:b20d754d5…
Size
2.7 MB
Last updated
about 1 month ago
docker pull mustafachyi/nordgen