# How to set up and remotely access a CasaOS server

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

For many individuals, the initial steps of [self-hosting](https://en.wikipedia.org/wiki/Self-hosting_\(web_services\)) and personal server setups can often appear daunting. Beginners frequently seek straightforward solutions that offer guidance without requiring significant commitments.

A tool novices use to familiarize themselves with self-hosting is [CasaOS](https://github.com/IceWhaleTech/CasaOS) — open-source software designed to convert a Linux machine into a functional personal server. CasaOS offers an intuitive web interface, simplifying the deployment and management of various [Docker-based](https://www.docker.com/) apps. Depending on the apps you decide to host, you may want remote access to the server. This would allow you to access your apps while away from home and perform remote maintenance.

By pairing CasaOS with [Meshnet](https://nordvpn.com/meshnet/), you can create a private device network that mimics a traditional [local area network](https://nordvpn.com/blog/what-is-lan/) (LAN) without [port forwarding](https://nordvpn.com/blog/port-forwarding/). This functionality enables seamless [remote access](https://nordvpn.com/meshnet/remote-access/) to your CasaOS server, regardless of your physical location.

To start, check out the video tutorial below for a visual walkthrough:

{% embed url="<https://youtu.be/PgXAJiqaMWY>" %}

Alternatively, if you prefer written instruction, this page contains a step-by-step guide on installing CasaOS on a Linux machine and establishing a remote connection using Meshnet.

## Installing CasaOS <a href="#installing-casaos" id="installing-casaos"></a>

CasaOS can be installed by using a single-line installation script. The script will check whether your system is compatible with CasaOS and then start downloading and installing all required software. To begin the installation:

1. Open **Terminal**.
2. Run the following command to execute the CasaOS installation script:\
   &#x20;

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">curl -fsSL https://get.casaos.io | sudo bash
   </code></pre>

You can monitor the installation progress in the terminal window. Once the installation is complete, you will see the address for accessing your CasaOS dashboard.

<div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2Fje8IEKdXz4SuBM0Cq0X2%2Fcasaos_web_url.png?alt=media&#x26;token=0d36cb63-31ad-46d8-b7b1-0f659d0f6042" alt="URL for accessing CasaOS web interface highlighted in the terminal."><figcaption></figcaption></figure></div>

### Access the CasaOS web interface <a href="#access-the-casaos-web-interface" id="access-the-casaos-web-interface"></a>

To use your CasaOS instance, navigate to its web interface and create an account.

1. Open your internet browser.
2. In the URL bar, enter the address shown after completing the CasaOS installation and press **Enter**.\
   &#x20;\
   **Example**\
   `http://192.168.202.83`\
   &#x20;
3. On the CasaOS welcome screen, select **Go**.
4. Type in your preferred username and password.
5. Click **Create**.

   <figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F6ySOQPUuAuf5837WNexD%2Fcasaos_create_account.png?alt=media&#x26;token=20d0eeff-7626-4f31-aee0-a76ae9245331" alt="&#x22;Create&#x22; button highlighted on the CasaOS account creation page."><figcaption></figcaption></figure>

The page should now reload and showcase your CasaOS dashboard.

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

If you forget your username or password, you can reset the credentials by following the instructions on the [CasaOS documentation](https://wiki.casaos.io/en/guides#user) page.
{% endhint %}

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

To streamline the process of installing apps on your home server, CasaOS has a dedicated App Store. In the store, you can choose from a wide range of popular apps, such as [Jellyfin](https://meshnet.nordvpn.com/how-to/remote-files-media-access/access-jellyfin-media-sever-remotely), [Pi-hole](https://meshnet.nordvpn.com/how-to/security/pi-hole), [Home Assistant](https://meshnet.nordvpn.com/how-to/remote-access/home-assistant), and many others. Alternatively, if you cannot find a wanted service in the store, you can manually configure and launch it using Docker.

### Method 1: From the App Store <a href="#method-1-from-the-app-store" id="method-1-from-the-app-store"></a>

This section will use [AdGuard Home](https://meshnet.nordvpn.com/how-to/security/protect-network-with-adguard-home) as an example. However, the process for installing other apps is nearly identical.

1. Open your CasaOS web interface.
2. Under **App**, select **App Store**.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FkxqKLHDylWEEXnZlahkF%2Fcasaos_app_store_card.png?alt=media&#x26;token=5e8fa7af-8314-4ebd-ab34-952c89e67625" alt="App store card highlighted." width="350"><figcaption></figcaption></figure></div>

   &#x20;
3. Locate the app you want to install.
4. Click the **Install** button if you wish to install it using the default configuration.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FISHohFXKrFVNBRofOaKS%2Fcasaos_app_install_default.png?alt=media&#x26;token=dea44dd6-cd4a-48d9-acbc-e0c2e5d5efee" alt="&#x22;Install&#x22; button for AdGuard Home highlighted."><figcaption></figcaption></figure></div>

   &#x20;\
   Otherwise, if you want to review the settings or make some adjustments before installing:

   1. Select the app in the App Store.
   2. Hover over the dropdown arrow next to the **Install** button and click **Custom install**.

      <figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FjTyNWYIrRgNqmE2NbeAF%2Fcasaos_app_install_custom.png?alt=media&#x26;token=8cd1085f-f759-4a47-bf21-692ee637a1a4" alt="Arrows pointing to the dropdown menu icon and the &#x22;Custom install&#x22; button."><figcaption></figcaption></figure>

      &#x20;
   3. Check and adjust the available values to your preference.
   4. Click **Install**.

      <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FRanMsZimavKJLGOEnONB%2Fcasaos_app_install.png?alt=media&#x26;token=f19b3409-d6b4-4c00-8d7d-8513d33b7bf5" alt="&#x22;Install&#x22; button highlighted." width="563"><figcaption></figcaption></figure></div>

      &#x20;
5. Close the installation dialog by clicking the **Continue in background** button.

Once the software is installed, you will see it under the **App** section of the dashboard. Click it to navigate to the app’s web interface.

<div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2Fhe18VD8jVSjENgJGRUdh%2Fcasaos_app_new.png?alt=media&#x26;token=c7d8248c-803d-47f1-afbb-c0ec745c3aa0" alt="AdGuard Home underlined under the App category." width="563"><figcaption></figcaption></figure></div>

### Method 2: Manual setup <a href="#method-2-manual-setup" id="method-2-manual-setup"></a>

CasaOS provides a graphical user interface (GUI) solution for manually deploying Docker containers. It provides you with all of the relevant fields where you need to enter the data for the app you want to install. To install an app manually:

1. Open your CasaOS web interface.
2. Under **App**, select **App Store**.
3. In the upper-right corner, click **Custom install**.
4. Fill in the **Manual app install** dialog with the data for your Docker container. The image below is an example of the [Kavita e-book server’s](https://meshnet.nordvpn.com/how-to/remote-files-media-access/kavita-ebook-server) Docker configuration.&#x20;

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FMSkrsvcmZ9g2wORhtXPo%2Fcasaos_manual_config.png?alt=media&#x26;token=e3ab3751-73f6-4394-855b-a23ce77f1d85" alt="Kavita Docker container configuration in CasaOS." width="375"><figcaption></figcaption></figure></div>

   &#x20;
5. Click **Install**.

Once the software is installed, you will see it under the **App** section of the dashboard. Click it to navigate to the app’s web interface.

<div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2F98DW0DvdFf0Uk0W5e2dJ%2Fcasaos_app_new_manual.png?alt=media&#x26;token=d88100b3-2e34-4e6a-a482-7c31656b9a0e" alt="&#x22;Kavita&#x22; underlined under the App category." width="563"><figcaption></figcaption></figure></div>

## Setting up Meshnet <a href="#setting-up-meshnet" id="setting-up-meshnet"></a>

After you’ve installed the apps you want to have on your server, you can proceed with setting up Meshnet to remotely access the server.

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

Take the following steps to set up NordVPN on your CasaOS server:

1. Open your CasaOS web interface.
2. In the upper-left corner, select **Terminal and logs**.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FQdvsmq2wEOGM1zZ9yVp0%2Fcasaos_terminal_and_logs.png?alt=media&#x26;token=cb9f4cbd-7520-443f-a1ac-3cfcca49ef09" alt="Arrow pointing to the &#x22;Terminal and logs&#x22; button on the CasaOS web interface."><figcaption></figcaption></figure></div>

   &#x20;
3. Under **Terminal**, enter the username and password of your Linux user account (not the CasaOS web account) 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%2FvzeKBFmycf0vM1PO5sms%2Fcasaos_terminal_login.png?alt=media&#x26;token=baf67420-1212-49a0-b822-4318c707922d" alt="Username and password of the CasaOS server filled in." width="563"><figcaption></figcaption></figure></div>

   &#x20;
4. Download and install the NordVPN Linux client by running this command:\
   &#x20;

   <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;
5. 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. On your server, 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 3fe460cefb8dcf1478c92e45908cec9f9bdbadf7a456a6dfb35dc2c58ee39d5b
   </code></pre>

You should now see a welcome message.

</details>

<details>

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

1. Run the following command:\
   &#x20;

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

   &#x20;
2. Open the provided link on any device in your browser.
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 %}

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

If you encounter the error message “Whoops! Permission denied accessing /run/nordvpn/nordvpnd.sock,” enter `sudo usermod -aG nordvpn $USER`. Then, reboot your server and log back in.
{% 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 device, enter the following command:

{% code overflow="wrap" %}

```bash
nordvpn meshnet peer list
```

{% endcode %}

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

For more convenient device access, you can [rename this device](https://meshnet.nordvpn.com/features/renaming-devices/linux#rename-this-device) and use its nickname instead of the default Nord name.
{% endhint %}

## Accessing CasaOS over Meshnet <a href="#accessing-casaos-over-meshnet" id="accessing-casaos-over-meshnet"></a>

Once Meshnet is set up, you can start accessing and using your CasaOS instance, and the apps hosted on it, from remote devices with the help of Meshnet. To remotely access CasaOS:

1. Copy the Nord name of your CasaOS server device from the NordVPN app.
2. Open your internet browser.
3. In the URL field, paste the copied Nord name followed by `:81/` and press **Enter**.\
   &#x20;\
   **Example**\
   `secret.meerkat-atlas.nord:81/`\
   &#x20;
4. Enter the login credentials for your CasaOS account and click **Log in**.

To access any of your hosted apps, simply click its card under the **App** section. The app’s web interface will open in a new browser tab.

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

To directly access a specific app, replace the `:81/` part of the URL in step 3 with the corresponding port number of the app you want to reach.

**Example**\
`secret.meerkat-atlas.nord:8096/`
{% endhint %}

## Optional: Configuring folder sharing <a href="#optional-configuring-folder-sharing" id="optional-configuring-folder-sharing"></a>

The **Files** app of CasaOS provides a simple interface for configuring and accessing [Samba ](https://en.wikipedia.org/wiki/Samba_\(software\))network shares. This allows you to make a folder accessible over the network or connect to a folder shared by another device.

### Share a folder <a href="#share-a-folder" id="share-a-folder"></a>

To start sharing a folder:

1. Open your CasaOS web interface.
2. Under **App**, select **Files**.
3. Navigate to the folder you want to share.
4. Hover over the folder, select the three-dot menu, and click **Share**.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FQ4q8hnCvC3Ls7xUjl6od%2Fcasaos_folder_share.png?alt=media&#x26;token=7c0c2aba-ba14-4e73-96e3-8032dd3024ee" alt="Arrow pointing to the three-dot menu button and the &#x22;Share&#x22; option is highlighted." width="284"><figcaption></figcaption></figure></div>

   &#x20;
5. Note the path to the shared folder and close the dialog by clicking **Got it**.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FpUCUHbuNaQAzGMjCeser%2Fcasaos_share_gotit.png?alt=media&#x26;token=005f4358-27ce-4eb0-86a0-83c4308df0de" alt="&#x22;Got it&#x22; button highlighted." width="563"><figcaption></figcaption></figure></div>

Now, your Meshnet peer devices can access the shared folder using the previously presented path. However, the local IP address must be replaced by the CasaOS server’s Nord name or Meshnet IP address.

**Example**\
`\\secret.meerkat-atlas.nord\Videos`

For detailed instructions on accessing shared folders from different platforms, consult the following pages:

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

### Connect to a shared folder <a href="#connect-to-a-shared-folder" id="connect-to-a-shared-folder"></a>

To access a folder shared by another Meshnet peer device:

1. Open your CasaOS web interface.
2. Under **App**, select **Files**.
3. On the left, next to **Location**, click the add (+) button and select **Connect to network storage**.

   <div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2FhSiO8900yBKApDrwBoVd%2Fcasaos_connect_network_storage.png?alt=media&#x26;token=ea377dc3-3040-459d-898f-d354263fb1b4" alt="The Add (plus) button and &#x22;Connect to network storage&#x22; option highlighted." width="330"><figcaption></figcaption></figure></div>

   &#x20;
4. In the **Server address field**, enter `smb://` followed by the Nord name of the Meshnet peer that has shared the folder.\
   &#x20;\
   **Example**\
   `smb://secret.meerkat-himalayas.nord`\
   &#x20;
5. Turn off the **Connect as guest** toggle and enter the authentication details for accessing the shared folder.
6. 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%2FErTXihe1rO4YH9yfYSMu%2Fcasaos_smb_connect.png?alt=media&#x26;token=08cf91fa-9c6a-4a03-ae67-d6f412b5e4c9" alt="Shared folder URL and authentication credentials entered and the &#x22;Connect&#x22; button is highlighted." width="563"><figcaption></figcaption></figure></div>

The **Files** app should now display all shared folders of the Meshnet peer device you specified. In addition, the network share will be available under the **Location** section on the left.

<div align="left"><figure><img src="https://3559400189-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0cTezbT2vN0lurEio8Z5%2Fuploads%2Fq593NkF2N8e2M3lIan7h%2Fcasaos_smb_location.png?alt=media&#x26;token=3f4782aa-3f3e-490a-a944-b31c1c3e94b4" alt="Added network share visible under &#x22;Location&#x22;." width="330"><figcaption></figcaption></figure></div>
