but3k4/nordvpn

By but3k4

Updated 8 months ago

Minimal Docker container establishing a secure NordVPN tunnel using OpenVPN.

Image
Networking
Security
0

976

but3k4/nordvpn repository overview

🌎 NordVPN Tunnel Container

Minimal NordVPN OpenVPN container based on Alpine Linux.

Designed for dynamic VPN tunneling, LAN WebUI access, torrenting, and full leak prevention, using automatic environment configuration.

📦 Features

  • Automatic NordVPN OpenVPN connection
  • Secure environment-based authentication
  • Light footprint (Alpine Linux base)
  • Production-grade connection checks
  • Perfect for transmission-tunneled torrenting setups

🐳 Quick Start

Run a default instance of NordVPN using Podman:

podman run -d --cap-add=NET_ADMIN --device /dev/net/tun --name vpn \
  -e NORD_USER="your_nordvpn_username" \
  -e NORD_PASS="your_nordvpn_password" \
  -e NORD_ENDPOINT="ie132.nordvpn.com" \
  -e LAN_NETWORK="192.168.1.0/24" \
  -p 9091:9091 \
  docker.io/but3k4/nordvpn:latest

Or with Docker:

docker run -d --cap-add=NET_ADMIN --device /dev/net/tun --name vpn \
  -e NORD_USER="your_nordvpn_username" \
  -e NORD_PASS="your_nordvpn_password" \
  -e NORD_ENDPOINT="ie132.nordvpn.com" \
  -e LAN_NETWORK="192.168.1.0/24" \
  -p 9091:9091 \
  docker.io/but3k4/nordvpn:latest

This container will dynamically:

  • Download your OpenVPN config
  • Authenticate securely
  • Establish a secure VPN tunnel
  • Fix routes dynamically (LAN accessible + Internet tunneled through VPN)
  • Protect against leaks

🔧 Environment Variables

VariableDescriptionRequiredExample
NORD_USERNordVPN usernameyourusername
NORD_PASSNordVPN passwordyourpassword
NORD_ENDPOINTNordVPN server endpoint (FQDN)ie132.nordvpn.com
LAN_NETWORKLAN subnet you want to keep accessible192.168.1.0/24

✅ If any required variable is missing, the container will exit with an error.

🔒 Security Features

  • Auth credentials written to isolated file inside container with proper permissions
  • OpenVPN file verified (not empty, valid certificate inside)
  • Routes dynamically adjusted only after VPN is UP
  • Full traffic redirection via VPN tunnel
  • LAN web interfaces (like Transmission, Deluge) accessible safely
  • No hardcoded IPs, fully dynamic

🛡️ Usage with Transmission

After the VPN container is running, launch Transmission using the same network namespace:

podman run -d --name transmission \
  --network container:vpn \
  -v /your/config:/config \
  -v /your/downloads:/downloads \
  -v /your/watch:/watch \
  lscr.io/linuxserver/transmission:latest

Or with Docker:

docker run -d --name transmission \
  --network container:vpn \
  -v /your/config:/config \
  -v /your/downloads:/downloads \
  -v /your/watch:/watch \
  lscr.io/linuxserver/transmission:latest

✅ Transmission traffic will be fully tunneled via NordVPN — no leaks possible.

📋 Podman/Docker Compose Example

version: "3.9"

services:
  nordvpn:
    image: docker.io/but3k4/nordvpn:latest
    container_name: nordvpn
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun
    environment:
      - NORD_USER=your_nordvpn_username
      - NORD_PASS=your_nordvpn_password
      - NORD_ENDPOINT=ie132.nordvpn.com
      - LAN_NETWORK=192.168.1.0/24
    ports:
      - "9091:9091"
    restart: unless-stopped

  transmission:
    image: lscr.io/linuxserver/transmission:latest
    container_name: transmission
    network_mode: "service:nordvpn"
    depends_on:
      - nordvpn
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Dublin
    volumes:
      - /your/downloads:/downloads
    restart: unless-stopped

➡️ Then launch it with:

podman-compose up -d

Or with Docker:

docker-compose up -d

✅ Transmission’s WebUI stays accessible on your LAN (e.g., http://192.168.1.10:9091), but all torrenting goes securely over the NordVPN tunnel.

📦 Image Details

FieldValue
Base Imagealpine:latest
Installedopenvpn, bash, curl
Exposed Port9091 (example, passthrough)
EntrypointDynamic entrypoint.sh (auto-routing)
Size~7.4MB

🪪 License

This project uses components from Alpine Linux, OpenVPN, and NordVPN’s public configurations, all under open-source or user-licensed agreements.

✨ Additional Notes

Future improvements could include:

  • Docker labels
  • GitHub Action for auto-push
  • Multi-architecture builds (e.g., amd64, arm64)

Feel free to contribute or fork! 🎯

Tag summary

Content type

Image

Digest

sha256:b15e977c8

Size

7.7 MB

Last updated

8 months ago

docker pull but3k4/nordvpn