# How to set up a remote NAS using OpenMediaVault and Meshnet

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

Having a robust [network-attached storage](https://www.seagate.com/blog/what-is-nas-master-ti/) (NAS) solution is vital in today’s digital landscape. Whether for personal or professional use, such a system is essential for storing and managing important files, including legal documents, invoices, or family photos and videos.

A frequent choice for a NAS solution is the free and open-source software [OpenMediaVault](https://www.openmediavault.org/about.html) (OMV). It’s an easy-to-use and highly customizable file-managing system that does not require extensive technical knowledge to set up. In addition, OMV offers web-based management, user and group access control, and plugin support for extending its functionality.

However, accessing shared folders on your NAS is typically limited to the same [local area network](https://nordvpn.com/blog/what-is-lan/) (LAN) when ports are not opened on your router. Thankfully, with [Meshnet](https://nordvpn.com/meshnet/), you can connect to your NAS remotely without compromising [network security](https://nordvpn.com/cybersecurity/network-security/). Meshnet allows using encrypted network tunnels to share data between your NAS and your end devices.

This guide describes how you can use OpenMediaVault to set up a remote NAS and access it using Meshnet.

## Installing OpenMediaVault <a href="#installing-openmediavault" id="installing-openmediavault"></a>

There are several ways in which you can install OpenMediaVault. This article demonstrates installing the OpenMediaVault 6.0.24 operating system in a virtual environment. However, the setup procedure is the same on bare-metal machines.

1. Download the ISO installation image from the [OpenMediaVault downloads page](https://www.openmediavault.org/download.html).
2. Follow the instructions in the [Installation using an ISO image](https://docs.openmediavault.org/en/latest/installation/via_iso.html) article in the OpenMediaVault documentation to complete the installation.

For alternative installation methods, see the [OpenMediaVault documentation](https://docs.openmediavault.org/en/latest/installation/index.html).

### Install available updates <a href="#install-available-updates" id="install-available-updates"></a>

After installing the OMV, you should update it by accessing the NAS using SSH. SSH access for the user `root` is enabled by default. To install the updates, follow these steps:

1. Open **Command Prompt** (on Windows) or **Terminal** (on macOS and Linux).

2. Connect to your NAS via SSH by running this command, where `<server>` is the local IP address of the NAS:<br>

   ```bash
   ssh root@<server>
   ```

   \
   **Example**

   ```bash
   ssh root@192.168.1.56
   ```

   &#x20;

3. Enter the root password you created during the installation process.

4. Run this command to gather and install all available updates:<br>

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

5. During the update process, you may be asked for keyboard inputs. Choose your input according to the on-screen information.

6. Once the updates finish, reboot your NAS.

## Configuring a NAS <a href="#configuring-a-nas" id="configuring-a-nas"></a>

OpenMediaVault has an intuitive web interface that allows you to configure various folder-sharing options. To access the web interface:

1. Open your internet browser.
2. Enter the local IP address of your NAS to the internet browser and press **Enter**.\
   \
   **Example**\
   `192.168.1.56`<br>
3. Log in to the administrator account using the default OpenMediaVault web interface credentials.
   * User name: `admin`
   * Password: `openmediavault`

Now you have full control of the NAS from within your internet browser.

### Change the default password <a href="#change-the-default-password" id="change-the-default-password"></a>

First, make sure to change the default password of the OpenMediaVault web interface to minimize the risk of unauthorized access.

1. Click **User settings** > **Change password** in the upper-right corner.\
   \
   ![Clicking 'Change password' in the OMV web interface.](https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FnbrOxalj0wy6hcnaYNa7%2Fomv_change_pass.png?alt=media\&token=0713d79c-bf29-476b-aca5-df76c0dc7aa8)<br>
2. Enter your new password in both fields and click **Save**.

### Personalize your dashboard <a href="#personalize-your-dashboard" id="personalize-your-dashboard"></a>

Once the password has been changed, you can customize your OMV dashboard. The dashboard allows you to easily monitor the status of essential services.

1. Head back to your dashboard by clicking the **Dashboard** tile.

2. Click the **settings page** link.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FXxyV7RFnyO15EPtcPSHr%2Fomv_settings_link.png?alt=media&#x26;token=c77e9c3a-7431-4be9-8882-82f0e1af7b19" alt="Clicking the &#x27;settings page&#x27; link."><figcaption></figcaption></figure></div>

3. Select the widgets you want to see on your dashboard and click **Save**.

All of the selected widgets are now visible on the OpenMediaVault dashboard.

<figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FFAAG4VQjHNaRB3d5nJpa%2Fomv_dashboard_widgets.png?alt=media&#x26;token=c71980f2-dfbb-4752-b62f-6384c7f30858" alt="OpenMediaVault dashboard with added widgets."><figcaption></figcaption></figure>

### Check disk availability <a href="#check-disk-availability" id="check-disk-availability"></a>

Before changing any further settings, it is essential to check if OpenMediaVault can see your storage mediums. You can do so by going to **Storage** > **Disks**.

<figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F5gKDtvzYzjdXzPr0RKMg%2Fomv_disks.png?alt=media&#x26;token=a3cae053-062f-4600-b6b0-9e375a47e5b4" alt="Table of available disks in OMV"><figcaption></figcaption></figure>

If any of your storage devices are not displayed, click the **Scan for new devices** button and select **Yes** to confirm.

### Set up a file system <a href="#set-up-a-file-system" id="set-up-a-file-system"></a>

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

If you use more than one disk for storage, you should configure a [redundant array of independent disks](https://docs.openmediavault.org/en/6.x/administration/storage/raid.html) (RAID).

In the OpenMediaVault web interface, RAID options can be found in **Storage** > **Software RAID**.
{% endhint %}

A file system is a method that an operating system uses to manage data on a storage disk. Without setting up a file system for your storage medium, you cannot share any folders as they will not be recognized as directories by the operating system.

To set up a file system:

1. Go to **Storage** > **File systems**.

2. Click the **Create and mount a file system** button and select [a file system](https://docs.openmediavault.org/en/6.x/administration/storage/filesystems.html), for example, **EXT4**.\
   \
   ![Selecting the EXT4 file system.](https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FhKIHj45kLkjwKCZS8sJH%2Fomv_fs_ext4.png?alt=media\&token=e8381654-37f6-4d75-8016-740f28f40d99)

   &#x20;

3. Select your storage from the **Device** dropdown and click **Save**.

4. Wait for the process to finish and select **Close**.

5. Choose your created file system from the **File system** dropdown, add any relevant tags, and click **Save** to mount the file system.<br>

   <figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FMran3ltVHb0UJizIfSsY%2Fomv_fs_mount.png?alt=media&#x26;token=a8ed0e3d-8d8d-4902-beb9-ef8fb57a229c" alt="Clicking &#x27;Save&#x27;."><figcaption></figcaption></figure>

6. In the **Pending configuration changes** panel, click the Apply button.<br>

   <figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F7AZM3WY1IELewcAuSJuH%2Fomv_fs_apply.png?alt=media&#x26;token=b8bef1d9-d213-4c14-9449-cbfe401b7a48" alt="Clicking the &#x27;Apply&#x27; button."><figcaption></figcaption></figure>

7. Select **Yes** to confirm.

The file system is now mounted on the operating system, and you can view it in the File systems section.

### Create shared folders <a href="#create-shared-folders" id="create-shared-folders"></a>

With the file system ready, you can start creating shared folders.

1. Go to **Storage** > **Shared folders**.

2. Click the **Create** button.

3. Fill in the required information.
   * **Name**: Enter any name for your shared folder.
   * **File system**: Select the file system you have set up.
   * **Relative path**: Enter a custom path to the folder you want to share. This section is filled in automatically after entering the name.
   * **Permissions**: Choose what permissions people accessing the shared folder have.
   * **Tags**: Add any relevant tags.

4. Click **Save**.<br>

   <figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2Fj9UOnv70kcG1DoVoPK1p%2Fomv_folder_create.png?alt=media&#x26;token=0e675428-ded5-446a-921c-5ea4222134b0" alt="Clicking &#x27;Save&#x27; in the shared folder creation menu."><figcaption></figcaption></figure>

5. In the **Pending configuration changes** panel, click the Apply button.

6. Select **Yes** to confirm.

Your shared folder should now appear in the Shared folders section.

<figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FOtdUeumPoPCoQgyMOqfi%2Fomv_folder_created.png?alt=media&#x26;token=667c47ed-a54a-44e0-8118-d040fd5a4a39" alt="The created shared folder."><figcaption></figcaption></figure>

### Enable sharing services <a href="#enable-sharing-services" id="enable-sharing-services"></a>

Though the shared folders have been created, they are currently inaccessible since no folder-sharing services are active. To enable sharing for your created folder:

1. Go to **Services** > **SMB/CIFS** > **Shares**.

2. Click the **Create** button.

3. Make the following adjustments:
   * **Shared folder**: Select the folder you created earlier.
   * **Public**: Select **Guest allowed** to allow passwordless guest access.<br>

     <figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FHV6x7Uf1977n4vv2whnW%2Fomv_smb_folder.png?alt=media&#x26;token=1511377a-239b-4de9-a251-a9fb8519b81e" alt="Selecting the name and the permissions of the shared folder."><figcaption></figcaption></figure>

4. Click **Save**.

5. Navigate to **Services** > **SMB/CIFS** > **Settings**.

6. Select the **Enabled** checkbox at the top to enable SMB/CIFS sharing and click **Save**.

7. In the **Pending configuration changes** panel, click the Apply button and select **Yes** to confirm.

Your NAS is now fully set up and functional. However, at this point, you can only access the shared folders from the same LAN.

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

If you wish to use your shared folder for [macOS Time Machine backups](https://meshnet.nordvpn.com/~/changes/Ppg3bMoVHwMks6LohjqQ/how-to/remote-access/macos-time-machine-backups), select the **Time machine support** option when enabling SMB/CIFS for the folder.
{% endhint %}

## Setting up NordVPN <a href="#setting-up-nordvpn" id="setting-up-nordvpn"></a>

To allow remote connections to the NAS, you need to install NordVPN and enable Meshnet. Since the OpenMediaVault operating system is based on Debian, you can [install and use the Linux version of the NordVPN app](https://nordvpn.com/download/linux/) hassle free.

### Install NordVPN on the NAS <a href="#install-nordvpn-on-the-nas" id="install-nordvpn-on-the-nas"></a>

Follow these steps to set up NordVPN on your NAS:

1. Access the NAS using SSH.
2. Download and install the NordVPN app for Linux by running the command below.<br>

   ```bash
   sh <(wget -qO - https://downloads.nordcdn.com/apps/linux/install.sh)
   ```

   &#x20;
3. 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

{% tabs %}
{% tab title="Log in using a token" %}

1. On any device, log in to your [Nord Account](https://my.ndaccount.com/) dashboard.&#x20;

2. Under **NordVPN Meshnet free**, select **View details**.<br>

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2Fsn49VgeZ6NMI13J7Ki1N%2Ftoken_generate0.png?alt=media&#x26;token=a773ba2c-27a9-4e88-b7bf-c4fe60cd2d42" alt="Clicking the &#x27;View details&#x27; button under NordVPN Meshnet free." width="563"><figcaption></figcaption></figure></div>

3. Scroll down until your see **Access token**.

4. Select the **Generate new token** button.<br>

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F4PoIcgMGswTyRI8d8b0i%2Ftoken_generate.png?alt=media&#x26;token=c0502a41-fdea-4212-bb19-5e1eb19638ba" alt="Clicking &#x27;Generate new token&#x27;." width="563"><figcaption></figcaption></figure></div>

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**.<br>

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2Fw2MaEvL5cIVshJPYkTbG%2Ftoken_generate2.png?alt=media&#x26;token=82907065-348b-4f0b-bee2-9ea49245a74a" alt="Selecting the token expiry option." width="563"><figcaption></figcaption></figure></div>

6. Select **Copy and close**.

7. On your NAS, run the `nordvpn login --token <your_token>` command, replacing `<your_token>` with the copied token.\
   \
   **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.

{% 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 %}
{% endtab %}

{% tab title="Log in using a URL" %}

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.\
   \
   **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.
{% endtab %}
{% endtabs %}

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

On your NAS, enable Meshnet on Linux by typing in this command:

```bash
nordvpn set meshnet on
```

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

```bash
nordvpn meshnet peer list
```

**Example**

<figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FkcJgGjBCSeVdWihJdjI3%2Fomv_mesh.png?alt=media&#x26;token=99ddc1a2-1ea4-4cc8-b1b9-601b17b9ad3e" alt="Enabling Meshnet and checking the Nord name and Meshnet IP of the NAS."><figcaption></figcaption></figure>

You will also see the list of your linked devices that can access this NAS over Meshnet.

## Connecting to the NAS over Meshnet <a href="#connecting-to-the-nas-over-meshnet" id="connecting-to-the-nas-over-meshnet"></a>

Your Meshnet devices should now be able to access the shared folders you have created on your NAS. To access the shared folders from your NAS, use this format `<server>/<shareName>`, where `<server>` is the Nord name or Meshnet IP address of the NAS and `<shareName>` is the name of the shared folder.

**Example**

`secret.meerkat-alps.nord/MeshnetStorage`

<figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F5blVeleDgxcFS175iAGO%2Fomv_remote_files.png?alt=media&#x26;token=ded8cacd-f3f9-4890-9f59-ab04f5e1eb01" alt="Files in the remote NAS."><figcaption></figcaption></figure>

For detailed, OS-specific instructions on accessing shared folders, see the following articles:

* [Accessing shared folders on Windows](https://meshnet.nordvpn.com/~/changes/Ppg3bMoVHwMks6LohjqQ/how-to/set-up-folder-sharing/configure-and-access-shared-folders-on-windows#access-shared-folders)
* [Accessing shared folders on macOS](https://meshnet.nordvpn.com/~/changes/Ppg3bMoVHwMks6LohjqQ/how-to/set-up-folder-sharing/configure-and-access-shared-folders-on-macos#access-shared-folders)
* [Accessing shared folders on Linux](https://meshnet.nordvpn.com/~/changes/Ppg3bMoVHwMks6LohjqQ/how-to/set-up-folder-sharing/configure-and-access-shared-folders-on-linux#access-shared-folders)
* [Accessing shared folders on iOS](https://meshnet.nordvpn.com/~/changes/Ppg3bMoVHwMks6LohjqQ/how-to/remote-files-media-access/set-up-folder-sharing/access-shared-folders-on-ios)
* [Accessing shared folders on Android](https://meshnet.nordvpn.com/~/changes/Ppg3bMoVHwMks6LohjqQ/how-to/remote-files-media-access/set-up-folder-sharing/access-shared-folders-on-android)

Additionally, you can access the OpenMediaVault web interface over Meshnet by entering the Nord name or the Meshnet IP address of the NAS in your internet browser’s address bar.

**Example**

<figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FUd7vlpdYcPv5TjKRE9Em%2Fomv_web_mesh.png?alt=media&#x26;token=690122d3-2500-4afc-882c-0291f784574c" alt="OpenMediaVault web interface accessed using the Nord name of the NAS."><figcaption></figcaption></figure>

&#x20;
