nordvpn-cli
Setting up a VPN on Linux doesn't have to be complicated. If you prefer the command line or want more direct control over your VPN connection, NordVPN's CLI (command-line interface) is a straightforward way to manage your privacy without touching a GUI. Let me walk you through the essentials.
Install
The easiest way to install NordVPN on Linux is a single command. Open your terminal and run:
sh <(curl -sSf https://downloads.nordcdn.com/apps/linux/install.sh)
This downloads and executes the official installer script. Once it completes, you're ready to authenticate.
Logging In to Your Account
After installation, authenticate with your NordVPN credentials:
nordvpn login
You'll be prompted to enter your username and password. Once authenticated, you can start connecting to servers.
Settings:
One of the most useful features in NordVPN CLI is the ability to decide whether other devices on your local network can "see" you.
Invisible in LAN
If you want to completely hide from other devices on your LAN (useful in shared networks or offices):
nordvpn set lan-discovery disable
However, if you have devices like printers, smart home equipment, or NAS drives you need to access, you can whitelist specific subnets:
nordvpn whitelist add subnet 172.17.0.0/16
nordvpn whitelist add subnet 192.168.1.0/24
This way, your VPN provides privacy from the outside world while letting your home devices communicate normally.
Visible in LAN
Want devices on your LAN to see you again? Simply enable LAN discovery:
nordvpn set lan-discovery enable
Set DNS
By default, NordVPN uses its own DNS servers, but you can change this to suit your needs. Here are some popular options:
Cloudflare DNS
Known for speed and privacy protection.
nordvpn set dns 1.1.1.1 1.0.0.1
Google DNS
Reliable and widely used, though Google does log some metadata.
nordvpn set dns 8.8.8.8 8.8.4.4
AdGuard DNS
Great for blocking ads and malware at the DNS level.
nordvpn set dns 94.140.14.14 94.140.15.15
Choose whichever aligns with your privacy preferences and performance needs.
Connecting to a VPN Server
Ready to encrypt your traffic? Connecting to a specific country is simple. For example, to connect to a Singapore server:
nordvpn c sg
You can replace sg with any country code. Once connected, your internet traffic is encrypted and routed through NordVPN's servers.