# Nordvpn
# Installing NordVPN on Linux distributions
In this article, we'll guide you through NordVPN installation and usage on Linux. We offer .deb and .rpm packages that are compatible with Debian, Ubuntu, Elementary OS, Linux Mint, Fedora, QubesOS, RHEL, CentOS, and openSUSE systems. The **NordVPN native application** is the **recommended option** for connecting to NordVPN servers on your Linux device. We designed it with your experience in mind, giving you features like auto-connect, automated **Kill Switch**, and **Threat Protection**.
## **Installing NordVPN on Linux**
To start using the NordVPN application for Linux, you need to **download the NordVPN Linux client**. You can do that in 2 ways:
1. By downloading a Snap package.
Snaps are app packages for desktop, cloud, and IoT that are easy to install, secure, cross-platform, and dependency-free. If you do not have Snap pre-installed, you may follow **Snap setup guides for various Linux distributions**.
*Please note that currently, we still do not support arm64, but our developers are working on this.*
2. By working in the terminal:
1. Open the terminal;
2. Write the command below: ```
sh <(curl -sSf https://downloads.nordcdn.com/apps/linux/install.sh)
```
3.Following any on-screen instructions.
**Note**: If you do not have a **curl** package, evidenced by the fact that the above does not work, you can alternatively use this command:
```
sh <(wget -qO - https://downloads.nordcdn.com/apps/linux/install.sh)
```
**Additionally**, if you receive the **following issue**: *Whoops! Permission denied accessing /run/nordvpn/nordvpnd.sock,* all you need to do is write the following command:
```
sudo usermod -aG nordvpn $USER
```
and then reboot your device
## **Using NordVPN on Linux**
After you have installed the NordVPN application, you can start using it!
*Please note that in NordVPN Linux application version 3.18.4, network traffic from the LAN through a VPN-connected computer is blocked by default. To unblock LAN traffic, turn LAN discovery ON or add to the allowlist any subnet or IP traffic to be forwarded*
### **Logging in**
If you're using a Linux device **without a graphical user interface,** follow our guide on **logging in to NordVPN on Linux devices without GUI**.
If you're using a Linux device with a graphical user interface, you can start using it with the commands below:
1. Log in to your NordVPN account by using this command:
```
nordvpn login
```
2. Connect to a NordVPN server by using the command below:
```
nordvpn connect
```
### **Account and settings**
Here you can find the list of available NordVPN commands for Linux.
Access the NordVPN client settings:
```
nordvpn
```
Get an extensive explanation of all commands:
```
man nordvpn
```
See the list of available commands or help for a specific command:
```
nordvpn help
nordvpn h
```
Log in or log out:
```
nordvpn login
nordvpn logout
```
Connect to a recommended NordVPN server:
```
nordvpn connect
nordvpn c
```
Connect to a specific server *(e.g. nordvpn connect uk715)*:
```
nordvpn connect
```
Disconnect from the VPN:
```
nordvpn disconnect
nordvpn d
```
See account information:
```
nordvpn account
```
Register a new user account:
```
nordvpn register
```
Rate your last connection quality (1-5):
```
nordvpn rate
```
See the current settings:
```
nordvpn settings
```
See the connection status:
```
nordvpn status
```
See the country list:
```
nordvpn countries
```
See the city list *(e.g.: nordvpn cities united\_states)*:
```
nordvpn cities
```
See a list of available server groups:
```
nordvpn groups
```
### **Specialty servers**
**Connect to the closest Double VPN server:**
```
nordvpn c double_vpn
```
Connect to a specific country using Double VPN servers:
```
nordvpn connect --group double_vpn
```
Connect to a P2P server:
```
nordvpn connect p2p
```
Connect to a specific country using P2P servers:
```
nordvpn connect --group p2p
```
Connect to a Dedicated IP server:
```
nordvpn connect Dedicated_IP
```
### **Features and configurations**
**Set a configuration option:**
```
nordvpn set
nordvpn s
```
Enable or disable Threat Protection:
```
nordvpn set threatprotectionlite on
nordvpn set threatprotectionlite off
```
Enable or disable Kill Switch:
```
nordvpn set killswitch on
nordvpn set killswitch off
```
Enable or disable auto-connect:
```
nordvpn set autoconnect on
nordvpn set autoconnect off
```
Set a specific server for automatic connection *(e.g.: nordvpn set autoconnect on us2435)*:
```
nordvpn set autoconnect on
```
Enable or disable notifications:
```
nordvpn set notify on
nordvpn set notify off
```
Set custom DNS *(you can set up a single DNS or two, just add spaces in between):*
```
nordvpn set dns 1.1.1.1 1.0.0.1
```
Switch between UDP and TCP protocols:
```
nordvpn set protocol udp
nordvpn set protocol tcp
```
Enable or disable obfuscated servers*:*
```
nordvpn set obfuscate on
nordvpn set obfuscate off
```
Set connection technology (OpenVPN or NordLynx):
```
nordvpn set technology OpenVPN
nordvpn set technology NordLynx
```
Turn Meshnet on or off on your device:
```
nordvpn set meshnet on
nordvpn set meshnet off
```
To enable or disable the post-quantum protection in NordVPN
### **LAN discovery and allowlists**
**Enable or disable LAN discovery:**
```
nordvpn set lan-discovery enable
nordvpn set lan-discovery disable
```
Get more information on LAN discovery:
```
nordvpn set lan-discovery --help
```
Add or remove a rule to allowlist a specified incoming port *(you can allowlist multiple ports — just separate their numbers with a space)*:
```
nordvpn whitelist add port
nordvpn whitelist remove port
```
Add or remove a rule to allowlist a specified subnet:
```
nordvpn whitelist add subnet
nordvpn whitelist remove subnet
```
# Automatically reconnect/log in on headless linux server
**PreReqs:**
1. Create a login token for your NordVPN account
2. While connected to NordVPN on your server, run the **ip link show** command in your console and determine the name of the interface used by NordVPN when it is active. If using NordLynx, the interface is likely to be named **nordlynx**. Be sure to note down the name as you'll need it for the script
**Using the script:**
```
#!/bin/bash
date=$(date)
#Log path example: /home/username/nord_reconnection.txt
log_path=PATH_WHERE_TO_LOG_MESSAGES
nord_token=YOUR_NORDVPN_LOGIN_TOKEN
# Uncomment webhook if you want to use a notification system
#webhook="YOUR WEBHOOK IN QUOTATION MARKS"
# While nordvpn is connected, run ip link show to determine the name of the interface used by nordvpn (for example nordlynx)
link_name=nordlynx
count=$( ip link show | grep $link_name | wc -l )
if [ $count -eq 0 ]; then
echo "-----------------------------------------------" >> $log_path
echo "Checking if logged in" >> $log_path
if echo `nordvpn connect` | grep -q "You are not logged in."; then
echo "NordVPN logging in: $date" >> $log_path
echo `nordvpn login --token $nord_token`
echo "Attempting to connect again: $date" >> $log_path
if echo `nordvpn connect` | grep -q "You are not logged in."; then
echo "Login was unsuccessful" >> $log_path
if [[ -v webhook ]]; then
echo `curl -X POST $webhook`
fi
else
echo "Login and connection successful" >> $log_path
fi
else
echo "Successfully connected" >> $log_path
fi
fi
```
1. Edit the log\_path variable with the path of where you want outputs from the script to go
2. Place your login token in the nord\_token variable
3. **Optional**: Uncomment the webhook variable and place your webhook **inside of the quotation marks**
4. If needed, replace **nordlynx** in the link\_name variable with the interface name you acquired in the prereq steps.
5. Save the script to your server and schedule it as a cron job