# How to set up OpenClaw AI assistant with Meshnet

## Introduction <a href="#introduction" id="introduction"></a>

[Artificial intelligence](https://nordvpn.com/cybersecurity/glossary/artificial-intelligence/) (AI) has made significant progress in recent years, with [AI agents](https://nordvpn.com/cybersecurity/glossary/intelligent-agent/) increasingly integrated into our daily lives. These agents automate tasks, manage communications, and execute complex tasks, making workflows more efficient. As AI technology advances, people are relying more heavily on AI agents to boost productivity.

[OpenClaw](https://openclaw.ai/) is an [open-source](https://github.com/openclaw/openclaw) AI assistant that enables users to automate digital tasks and interact with various applications. With its ability to run on most machines, remember context, and autonomously handle real tasks via different messaging channels, OpenClaw offers a unique solution for people looking to maximize AI power.

With OpenClaw and [Meshnet](https://nordvpn.com/meshnet/) combined, you can access and control your instance remotely, no matter where you are. Meshnet creates a virtual network that connects devices worldwide, mimicking a [local area network](https://nordvpn.com/blog/what-is-lan/) (LAN). The use of the [NordLynx protocol](https://nordvpn.com/blog/nordlynx-protocol-wireguard/) in Meshnet ensures that the communication between devices matches the security standards of a [VPN](https://nordvpn.com/) connection.

This article demonstrates how you can set up your OpenClaw instance and use it over Meshnet.

## Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

If you’re using a Linux device, you can proceed directly to the [next section](#configure-the-openclaw-ai-assistant).

As for Windows devices, it is highly recommended to install OpenClaw using [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/) (WSL). WSL installs a light-weight version of a chosen Linux distribution. This approach ensures that the packages required for running OpenClaw can be installed and managed as the creator intended.

<details>

<summary>Install WSL</summary>

To install WSL on your Windows machine:

1. Open **PowerShell** as an administrator.

   <div align="left"><figure><picture><source srcset="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F2Cjip86wbJxLFVPa7p7Y%2Fwin_ps_admin_dark.png?alt=media&#x26;token=22b4b13c-4d79-4f5f-9b73-c7658fcee1ea" media="(prefers-color-scheme: dark)"><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F8OPk8Is6CO5UbPFynoNR%2Fwin_ps_admin.png?alt=media&#x26;token=59d6337a-d297-4bdb-90c7-9f9a8046599a" alt="&#x22;Run as Administrator&#x22; option highlighted in the Windows search." width="563"></picture><figcaption></figcaption></figure></div>

   &#x20;
2. Run the command below to install the recommended version of Ubuntu via WSL.

   ```powershell
   wsl.exe --install
   ```

   &#x20;
3. Wait until the installation process is finished.
4. When requested, create the username and password for your Ubuntu user account.
5. Fetch and install all available updates for your system by running the following command:

   ```bash
   sudo apt update && sudo apt upgrade -y
   ```

   &#x20;

   If required, enter the Ubuntu account password you just created and press **Enter**.

Your WSL2 instance is now installed and ready for use. To access it, launch **Ubuntu** from your Windows start menu.&#x20;

<div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FinQ5R7VNXsmKkWhIoutq%2Fopencrawl_ubuntu_run_dark.png?alt=media&#x26;token=ae409a91-ced0-4696-b226-a83927d079b7" alt="Launching Ubuntu from the Windows search." width="563"><figcaption></figcaption></figure></div>

All further instructions should be performed inside the WSL terminal.

{% hint style="info" %}
**Note**

When installing WSL for the first time, you may be required to restart your computer.
{% endhint %}

</details>

## Configure the OpenClaw AI assistant <a href="#configure-the-openclaw-ai-assistant" id="configure-the-openclaw-ai-assistant"></a>

The most convenient way to begin with OpenClaw is to use its installation script. It installs software required to run OpenClaw and guides you through the onboarding procedure.

### Install OpenClaw <a href="#install-openclaw" id="install-openclaw"></a>

In **Terminal**, run the following command to download and run the OpenClaw installation script.

{% code overflow="wrap" %}

```bash
curl -fsSL https://openclaw.ai/install.sh | bash
```

{% endcode %}

The script will check your system and install all of the prerequisites needed to run OpenClaw.

### Begin OpenClaw onboarding <a href="#begin-openclaw-onboarding" id="begin-openclaw-onboarding"></a>

Once the installation process successfully finishes, it will begin the OpenClaw onboarding procedure.

1. Read through the security warning, choose the **Yes** option using the arrow keys, and press **Enter**.
2. Select the **QuickStart** onboarding mode.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FaUvBs77Rvn5d84x7G0hz%2Fopencrawl_onboarding_quickstart.png?alt=media&#x26;token=7f5d47cd-e640-4d87-867f-b7686fd60cc0" alt="Selecting the &#x22;QuickStart&#x22; onboarding option."><figcaption></figcaption></figure></div>

### Choose OpenClaw settings <a href="#choose-openclaw-settings" id="choose-openclaw-settings"></a>

1. Pick your preferred AI provider, authenticate using one of the available methods, and select the default AI model your assistant will use.
2. Under **Select channel (QuickStart)** choose **Skip for now**.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FQVuRDJ66UE2J9prjK64H%2Fopenclaw_onboarding_channel.png?alt=media&#x26;token=ac92c9f0-ccd6-420b-af9f-0bd33588376f" alt="Selecting the &#x22;Skip for now&#x22; channel." width="563"><figcaption></figcaption></figure></div>

   &#x20;
3. Choose whether you want to install any assistant skills right now. Otherwise, select **No**.
4. Enter any of the shown API key options or choose **No**.
5. Under **Enable hooks?** select **Skip for now**. This is an advanced feature that can be configured later.
6. Lastly, choose **Do this later** and pick **Yes** to install the shell completion script.
7. Update your path environment variable to accommodate OpenClaw with this command:

   ```bash
   export PATH="$(npm prefix -g)/bin:$PATH" && source ~/.bashrc
   ```

The onboarding process is now finished.

### Allow local and Meshnet connections <a href="#allow-local-and-meshnet-connections" id="allow-local-and-meshnet-connections"></a>

By default, OpenClaw is bound to the `loopback` network interface, meaning that it accepts connections only from the device on which it is installed. You will need to modify the OpenClaw configuration file to permit incoming connections from the local network and via Meshnet.

1. Run the following command to open the OpenClaw configuration file using the Nano text editor:

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">nano ~/.openclaw/openclaw.json
   </code></pre>

   &#x20;

2. Locate the `"bind"` field and change its value from `"loopback"` to `"lan"` as shown:

   ```json
   "bind": "lan",
   ```

3. Enable remote HTTP-only connections, which will be used for Meshnet access, by adding the following block to the file, under the `"bind": "lan",` line:

   <pre class="language-json" data-overflow="wrap"><code class="lang-json">    "controlUi": {
         "enabled": true,
         "allowInsecureAuth": true
       },
   </code></pre>

   &#x20;\
   The modified area of the file should look as such:

   <figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FCj28Uiuwz6jRQcKNvPBT%2Fopenclaw_config_file.png?alt=media&#x26;token=19e15e1f-c7ce-43f0-af32-68f71d35b617" alt="Extract from the modified configuration file."><figcaption></figcaption></figure>

   &#x20;

4. Press **Ctrl** + **X**, **Y**, and **Enter** to save changes and exit.

5. Restart the OpenClaw gateway to apply the changes with the command below:

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">openclaw gateway restart
   </code></pre>

If the changes to the configuration file were done correctly, the OpenClaw gateway should restart successfully and your AI assistant will be able to accept connections from the LAN and over Meshnet.

## Set up Meshnet

With the configuration changes applied, you can start setting up Meshnet.

### Install NordVPN <a href="#install-nordvpn" id="install-nordvpn"></a>

Follow these steps to install NordVPN on your device:

1. Download and install the NordVPN Linux client by running the command below.

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">sh &#x3C;(wget -qO - https://downloads.nordcdn.com/apps/linux/install.sh)
   </code></pre>

   &#x20;
2. Log in to your NordVPN account.

### Log in to NordVPN <a href="#log-in-to-nordvpn" id="log-in-to-nordvpn"></a>

You can log in to your NordVPN account without the use of a graphical user interface (GUI) in two ways:

* By running the `nordvpn login` command with the `--token` flag
* By running the `nordvpn login` command with the `--callback` flag

Instructions for both methods are outlined below.

<details>

<summary>Log in using a token</summary>

1. On any device, log in to your [Nord Account](https://my.ndaccount.com/) dashboard and select the **Meshnet (by NordVPN)** card.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FxpqHfJyxPLb25uHSZ74I%2Fucp_meshnet_card.png?alt=media&#x26;token=c9bc9798-bc96-4dfc-8ac7-8a3cf1b4538a" alt="&#x22;Meshnet (by NordVPN)&#x22; card highlighted."><figcaption></figcaption></figure></div>

   &#x20;
2. Under **Advanced settings**, select **Get access token**.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FJn3YfCSN2rokFjnMJAzS%2Fucp_get_token.png?alt=media&#x26;token=9f657403-0eff-47af-8da3-4a4837db5d4b" alt="Clicking the &#x27;Set up NordVPN manually&#x27; button."><figcaption></figcaption></figure></div>

   &#x20;
3. Enter the verification code sent to your email address.
4. Under **Access token**, click **Generate new token**.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F2rdjIz6B8KD69EpvERV2%2Fucp_generate_token.png?alt=media&#x26;token=ca21fa64-1669-4786-945f-d2af2fec5cdb" alt="Clicking &#x27;Generate new token&#x27;."><figcaption></figcaption></figure></div>

   &#x20;
5. In the dialog that appears, choose either a token that expires in 30 days or one that never expires, and then select **Generate token**.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FM44Zi3LCVbbovfM5sCra%2Fucp_generate_new.png?alt=media&#x26;token=c06d9740-1a21-4acd-8246-fc81208576bb" alt="Selecting the token expiry option." width="563"><figcaption></figcaption></figure></div>

   &#x20;
6. Select **Copy and close**.
7. In your Proxmox shell, run the `nordvpn login --token <your_token>` command, replacing `<your_token>` with the copied token.\
   &#x20;\
   **Example**

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">nordvpn login --token 3fe460cefb8dcf1478c92e45903cec9f9bdbadf7a456a6dfb35dc2c58ee39d5b
   </code></pre>

You should now see a welcome message.

</details>

<details>

<summary>Log in using a URL</summary>

1. Run the `nordvpn login` command.
2. Open the provided link in your browser on any device.
3. Complete the login procedure.
4. Right-click the **Continue** button and select **Copy link address**.
5. Run the `nordvpn login --callback "<URL>"` command, replacing `<URL>` with the previously copied link address.\
   &#x20;\
   **Example**

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">nordvpn login --callback "nordvpn://login?action=login&#x26;exchange_token=MGFlY2E1NmE4YjM2NDM4NjUzN2VjOWIzYWM3ZTU3ZDliNDdiNzRjZTMwMjE5YjkzZTNhNTI3ZWZlOTIwMGJlOQ%3D%3D&#x26;status=done"
   </code></pre>

You should now see a welcome message.

</details>

{% hint style="success" %}
**Tip**

To preserve your token when logging out of the NordVPN app, use the `nordvpn logout --persist-token` command. Otherwise, your token will be revoked.&#x20;
{% endhint %}

### Enable Meshnet <a href="#enable-meshnet" id="enable-meshnet"></a>

Upon logging in, [enable Meshnet](https://meshnet.nordvpn.com/getting-started/how-to-start-using-meshnet/using-meshnet-on-linux#enable-meshnet-on-linux) with this command:

{% code overflow="wrap" %}

```bash
nordvpn set meshnet on
```

{% endcode %}

To view the Nord name and Meshnet IP address of your instance, enter the following command:

{% code overflow="wrap" %}

```bash
nordvpn meshnet peer list
```

{% endcode %}

## Access OpenClaw over Meshnet

With Meshnet and OpenClaw setups finalized, you can connect to your OpenClaw instance using Meshnet.

1. Copy the Nord name or the Meshnet IP address of OpenClaw machine from the NordVPN application.
2. Open your internet browser.
3. In the URL bar, paste the copied Nord name or Meshnet IP address followed by `:18789/` and press **Enter**.\
   \
   **Example**\
   `secret.meerkat-fuji.nord:18789/`

Once the page loads, you will be greeted with an error message. This is expected, as OpenClaw requires authentication before granting access to the dashboard.

<figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FXl8WgRbzuKxAhLLsov36%2Fopenclaw_web_1008.png?alt=media&#x26;token=117165fd-6ab3-4613-8b12-7b687e2a805a" alt="OpenClaw web gateway open in an internet browser."><figcaption></figcaption></figure>

### Get the authentication token

The default authentication method for OpenClaw is using a token. The token must be fetched from the device on which OpenClaw is installed. You can choose from two different methods to get it.

{% tabs %}
{% tab title="Method 1: using OpenClaw CLI" %}

1. Run the following command to display the OpenClaw dashboard details:

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">openclaw dashboard --no-open
   </code></pre>

   &#x20;
2. The `Dashboard URL` address contains the login token for your OpenClaw dashboard. Copy all of the symbols following the `?token=` part of the URL to your clipboard.

   <figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FuaHg0U2DtfMMRQP8Xz8Z%2Fopenclaw_token_url.png?alt=media&#x26;token=93801418-b090-445a-9bd5-20c85b984f6b" alt="Token highlighted in Terminal."><figcaption></figcaption></figure>

{% endtab %}

{% tab title="Method 2: using jq tool" %}
You can use [jq](https://github.com/jqlang/jq), a command-line JSON processor, to parse the token value directly from the OpenClaw configuration JSON file.

1. Install jq with this command:

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">sudo apt install jq -y
   </code></pre>

   &#x20;
2. Use the command below to get the authentication token:

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">cat ~/.openclaw/openclaw.json | jq -r '.gateway.auth.token'
   </code></pre>

   &#x20;
3. Copy to token to your clipboard.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FekXhpuJUuRshM72AMk90%2Fopenclaw_token_jq.png?alt=media&#x26;token=89bad025-8c51-44fa-b6e6-ca16421472b3" alt="Token highlighted in Terminal."><figcaption></figcaption></figure></div>

{% hint style="info" %}
**Note**

The command may work if the layout of your configuration file is different. In such a case, refer to the first method.
{% endhint %}
{% endtab %}
{% endtabs %}

### Authenticate the OpenClaw dashboard <a href="#authenticate-the-openclaw-dashboard" id="authenticate-the-openclaw-dashboard"></a>

1. Open your OpenClaw gateway dashboard.
2. From the menu on the left, select **Overview**.
3. Under **Gateway access**, locate the **Gateway token** field.
4. Paste in the authentication token copied earlier and click **Connect**.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FjxfPEaG0fYOfwFNIcwk2%2Fopenclaw_token_connect.png?alt=media&#x26;token=1b45419c-7b37-4961-bd0d-8692b1f69fa5" alt="Pasting the authentication token and clicking &#x22;Connect&#x22;."><figcaption></figcaption></figure></div>

You should see the **Status** on the right change to “Connected”.

### Chat to your AI assistant <a href="#chat-to-your-ai-assistant" id="chat-to-your-ai-assistant"></a>

Lastly, you can finalize setting up your OpenClaw AI assistant and begin chatting with it.

1. In the OpenClaw dashboard, from the menu on the left, select **Chat**.
2. Send any message to prompt the setup procedure.
3. Answer the questions provided by the AI agent to configure its properties.

That’s it. Your personal OpenClaw AI assistant is now ready to be used over a secure Meshnet connection from anywhere in the world. You can further improve it by setting up any of the various [integrations available for OpenClaw](https://openclaw.ai/integrations).
