Setting up NordVPN Meshnet on the Raspberry Pi

In this tutorial, we will show you how to set up NordVPN’s Meshnet on your Raspberry Pi.

Raspberry Pi NordVPN Meshnet

Meshnet is a service provided by NordVPN for free that allows you to connect multiple devices easily over the internet.

This works by creating a virtual private network between all your devices. This allows devices to act and function as if they were connected over the same LAN network despite potentially being in a completely different location.

If you have ever used other services such as Tailscale or Zerotier then you will be somewhat familiar with how NordVPN’s Meshnet works.

Best of all, you don’t actually need an active NordVPN subscription to utilize the Meshnet service. It is offered for free to anyone; all you need is a NordVPN account.

In addition, NordVPN offers some fairly decent limitations for their Meshnet. You can link up to 10 devices from one account and another 50 if you include other people within your network.

Of course, NordVPN is an excellent choice as a VPN provider. Follow our link for a discount on signing up to NordVPN (Affiliate Link).

Equipment

Below is a list of the equipment we used to set up the NordVPN Meshnet on our Raspberry Pi.

Recommended

Optional

This tutorial was last tested on a Raspberry Pi 5, running the latest version of Raspberry Pi OS Bookworm.

Installing and Running NordVPN Meshnet on the Raspberry Pi

In the following sections, we will walk you through installing and running Meshnet on your Raspberry Pi.

These tutorials will all be completed within the terminal. If you are running a desktop flavor, you will want to open the terminal by pressing CTRL + ALT + T.

Preparing your Raspberry Pi

1. Before we set up the NordVPN Meshnet on our Raspberry Pi, we will ensure that our operating system is up to date.

You can update the package list cache and upgrade any out-of-date packages by running the following two commands.

sudo apt update
sudo apt upgrade -y

2. The only package we require to set up this networking tool is curl. We will be using curl to execute the NordVPN install script.

Typically, curl will come pre-installed with Raspberry Pi OS, but you can ensure it is installed by using the command below in the terminal.

sudo apt install curl

Installing NordVPN to Access Meshnet on your Raspberry Pi

4. With your Pi now prepared, all you need to do to install the NordVPN client on your Raspberry Pi is to run the command below.

This command uses curl to grab the official install script from the NordVPN CDN. It then passes this installation script back to the shell where it is executed.

sh <(curl -sSf https://downloads.nordcdn.com/apps/linux/install.sh)

The script we are running adds the NordVPN package repository to your system and then automatically installs the NordVPN client. It will also add your current user to the new “nordvpn” group.

5. Before you can proceed with setting up Meshnet on your Raspberry Pi, you will need to restart it.

You can restart your Pi by using the reboot command.

sudo reboot

Logging into NordVPN

6. Once your Pi has finished restarting, you can now log in to NordVPN using your account by running the following command.

As mentioned earlier, you must log in to a NordVPN account. However, you don’t require an active subscription to use Meshnet.

You can begin the login process by using the following command within the terminal

nordvpn login

After running the previous command, you will get a message asking you to go to a URL. Open this URL in your favorite browser to continue.

Continue in the browser: https://api.nordvpn.com/v1/users/oauth/login-redirect?attempt=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX

7. Once logged in, you will be greeted with a big “Continue” button.

Right-click the “Continue” button and click the “Copy link” option. You need this link to complete the login process within the terminal.

Get Login Code for NordVPN Meshnet on the Raspberry Pi

The URL should look like the one we have shown below. You will need this URL for the next step.

nordvpn://login?action=login&exchange_token=MGFlY2E1N
mE4YjM2NDM4NjUzN2VjOWIzYWM3ZTU3ZDliNDdiNzRjZTMwMjE5Yjk
zZTNhNTI3ZWZlOTIwMGJlOQ%3D%3D&status=done

8. Back in the terminal, use the following command to log in your Raspberry Pi into the NordVPN network. This will also be what will allow us to enable the Meshnet service.

Ensure you replace “<URL>” with the URL you got in the previous step.

nordvpn login --callback "<URL>"

An example of how this command would look with a valid login URL is shown below.

nordvpn login --callback "nordvpn://login?action=login&exchange_token=MGFlY2E1N
mE4YjM2NDM4NjUzN2VjOWIzYWM3ZTU3ZDliNDdiNzRjZTMwMjE5Yjk
zZTNhNTI3ZWZlOTIwMGJlOQ%3D%3D&status=done"

9. If you have successfully logged in to the NordVPN network, you should see the following message within the terminal.

This means we can finally move on to enabling the Meshnet feature on our Raspberry Pi.

Welcome to NordVPN! You can now connect to VPN by using 'nordvpn connect'.

Turning on Meshnet on the Raspberry Pi

10. Now that we have installed the NordVPN command line tool, enabling the Meshnet feature on our Raspberry Pi is as simple as using the following command within the terminal.

Running this command will enable Meshnet and then connect you to any other devices you have Meshnet set up on.

nordvpn set meshnet on

Below, you can see that “Meshnet” has been enabled successfully.

Meshnet is set to 'enabled' successfully.

11. You can ensure that you have Meshnet enabled by running the following command in the terminal.

This command will print out details of your current device, as well as any peers you are connected with.

nordvpn meshnet peer list

Below, you can see how we can easily see the hostname and IP address that Meshnet assigned to our Raspberry Pi. We can use the hostname or IP address to connect to this machine as long as we are part of the same Meshnet network.

This device:
Hostname: examplename-everest.nord
Nickname: -
IP: XXX.XX.XXX.234
Public Key: XXXXXXXXX0YXXXgpd6Xs/XX0M/58ZbXXXXXQ6mXXX=
OS: linux
Distribution: Debian GNU/Linux

Local Peers:
[no peers]

External Peers:
[no peers]

Conclusion

By this point in the tutorial, you should now have NordVPN’s Meshnet set up and running on your Raspberry Pi.

Meshnet is a super neat technology that makes setting up a virtual network between your devices a simple process.

Please feel free to comment below if you have questions about using Meshnet on your Pi.

If you found this project to be helpful, we recommend that you check out our many other Raspberry Pi projects.

Leave a Reply

Your email address will not be published. Required fields are marked *