Docker container based on NordVPN's example Dockerfile.
File | Description |
---|---|
README.md | The file that you're reading now. |
LICENSE.md | MIT License text. |
ubuntu/Dockerfile | Container configuration. |
alpine/Dockerfile | Experimental. (Not working yet.) |
.env | Your NordAccount credentials. |
Vagrantfile | Example VM configuration. (optional) |
bin/start-vm | Example VM start-up script. |
bin/start-container | Example container start-up script. |
- Build the image (tagged with the name, "nordvpn")
docker build -t nordvpn .
- Run the container
# attached to terminal
docker run -it --cap-add=NET_ADMIN --device=/dev/net/tun nordvpn
# or detached
CID=$(docker run -d --cap-add=NET_ADMIN --device=/dev/net/tun nordvpn)
You can save your NordAccount credentials in .env
.
Example:
[email protected]
NORDACCOUNT_PASSWORD=XEt_vCjC5uECg@Pw
Login to NordVPN
docker exec $CID nordvpn login --username "$NORDACCOUNT_USERNAME" --password "$NORDACCOUNT_PASSWORD"
Connect to VPN (examples)
# connect to any server in Canada
docker exec $CID nordvpn connect Canada
# connect to any server in Vancouver, Canada
docker exec $CID nordvpn connect Canada Vancouver
# connect to any server in Toronto
docker exec $CID nordvpn connect Toronto
Disconnect from VPN
docker exec $CID nordvpn disconnect
List available commands
docker exec $CID nordvpn --help