# How to use Home Assistant remotely over Meshnet

## Introduction

[Home Assistant](https://www.home-assistant.io/) is the leading free and open-source smart home control system. It enables seamless addition, control, and automation of smart devices without depending on third-party cloud solutions. Since Home Assistant functions locally, it is not reachable from outside without [port forwarding or a VPN](https://nordvpn.com/blog/port-forwarding/) to your home network.

Enter [Meshnet](https://nordvpn.com/meshnet/), a solution that establishes encrypted tunnels between your devices, allowing direct and secure remote access from any device to your Home Assistant instance. With this setup, you can monitor and control your [Internet of Things](https://nordvpn.com/blog/internet-of-things/) (IoT) devices from anywhere in the world.

Watch the video below for an overview of the setup process or follow along with our step-by-step written instructions to set up your own Home Assistant instance in a [Docker container](https://www.docker.com/resources/what-container/) and remotely control it using Meshnet.

{% embed url="<https://www.youtube.com/watch?v=yiNKVJpWhQk>" %}

## Install Docker

To follow this guide, you must have Docker installed on your device. You can find instructions for downloading and installing Docker on the Docker website:

* [Docker Desktop instructions for Windows](https://docs.docker.com/desktop/install/windows-install/)
* [Docker Desktop instructions for macOS](https://docs.docker.com/desktop/install/mac-install/)
* [Docker Desktop Instructions for Linux (app with a GUI)](https://docs.docker.com/desktop/install/linux-install/)
* [Docker Engine instructions for Linux (CLI only)](https://docs.docker.com/engine/install/)

## Create a Home Assistant Docker container

With Docker installed, you can start creating Docker containers for various services, including Home Assistant.

For this guide, [Docker run](https://docs.docker.com/engine/reference/run/) will be used. If you prefer the [Docker Compose](https://docs.docker.com/compose/) method, you can find instructions on the [Home Assistant website](https://www.home-assistant.io/installation/alternative/#docker-compose).

### Creating a volume

First, you need to create a dedicated [Docker volume](https://docs.docker.com/storage/volumes/) where the container's files will be stored. Without a persistent volume, all of the instance's files are lost once the container is stopped. You can create the volume directly from the Docker Desktop app or via the command line.

{% tabs %}
{% tab title="Using Docker Desktop" %}

1. Open the **Docker Desktop** app.
2. From the menu on the left, select **Volumes**.

   <div align="left"><figure><picture><source srcset="/files/fWzSuZCaqL1ZQG3iksvo" media="(prefers-color-scheme: dark)"><img src="/files/VEvyPazh6P8mAA24VRmx" alt="Docker Desktop application"></picture><figcaption></figcaption></figure></div>

   &#x20;
3. If you don't have any volumes created, select the **Create a volume** button. Otherwise, click **Create** in the upper-right corner.
4. In the **Volume name** field, type in `homeassistant_config` and click **Create**.

   <div align="left"><figure><picture><source srcset="/files/X9Lcv4jU3gYtToPZ5co2" media="(prefers-color-scheme: dark)"><img src="/files/dc7q9wvaYpGVoNteMVuI" alt="Name of the new Docker volume." width="375"></picture><figcaption></figcaption></figure></div>

The newly created volume will now be visible in the **Volumes** section.
{% endtab %}

{% tab title="Using the command line" %}

1. Open **Command Prompt** (on Windows) or **Terminal** (on Linux or macOS).
2. Run the following command to create a volume called `homeassistant_config`:\
   &#x20;

   <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">docker volume create homeassistant_config
   </code></pre>

If the creation is successful, you will see the name of your volume in the command line window.
{% endtab %}
{% endtabs %}

### Creating a container

With the volume ready for Home Assistant, you can proceed to create the Docker container itself.

1. Open **Command Prompt** (on Windows) or **Terminal** (on Linux or macOS).
2. Depending on your operating system, execute one of the following `docker run` commands, replacing `<TimeZone>` with your [time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones):\
   &#x20;
   * If you're running Windows or macOS, use the command below:

     <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">docker run -d --name homeassistant --privileged --restart=unless-stopped -p 8123:8123 -e TZ=&#x3C;TimeZone> -v homeassistant_config:/config ghcr.io/home-assistant/home-assistant:stable
     </code></pre>

     &#x20;\
     **Example**

     <div align="left"><figure><img src="/files/nGo74J3Jyo1r2JNVEJk2" alt="Example docker run command to deploy a Home Assistant container"><figcaption></figcaption></figure></div>

   * If you're using Linux, run this command:

     <pre class="language-bash" data-overflow="wrap"><code class="lang-bash">docker run -d --name homeassistant --privileged --restart=unless-stopped -p 8123:8123 -e TZ=&#x3C;TimeZone> -v homeassistant_config:/config --network=host ghcr.io/home-assistant/home-assistant:stable
     </code></pre>

Docker will [pull the Home Assistant image](https://docs.docker.com/engine/reference/commandline/pull/) from Docker Hub and create the container.

If the creation is successful, you will see the full container ID of your Home Assistant container in the command line window.

## Set up Home Assistant

Once the container is running, you can start using Home Assistant. By default, the Home Assistant service listens on port `8123`, unless you've configured it differently.

1. Open your internet browser and visit your Home Assistant page.
   * If you are accessing Home Assistant from the host device directly, you can use the following URL:\
     `http://localhost:8123/`\
     &#x20;&#x20;

     <figure><img src="/files/qKA8sQyVqXO1kgj60fHn" alt="Home Assistant account creation screen"><figcaption></figcaption></figure>

     &#x20;
   * Otherwise, you must use the device’s local IP address instead of the `localhost` part.

2. Create your Home Assistant account and finish the setup process.

Now, when you visit your Home Assistant page again, you will be prompted to log in to your account. Upon logging in, you will be taken to your Home Assistant dashboard, where you can configure your devices and services.

## Access Home Assistant remotely

Your Home Assistant is now fully set up. With Meshnet enabled on the host device, the Home Assistant dashboard can be [accessed remotely](https://nordvpn.com/meshnet/remote-access/) by other devices in your Meshnet.

{% hint style="warning" %}
**Caution**

Ensure you set up strong user authentication. Without it, other devices in your Meshnet that have [remote access permissions](/features/explaining-permissions/remote-access-permissions.md) enabled can interact with your Home Assistant instance, potentially compromising its security.
{% endhint %}

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

If you're hosting Home Assistant on a Linux device, you must grant the [local network permission](/features/explaining-permissions/local-network-permissions.md) for the devices accessing it. For more information, see [Common issues on Linux](/troubleshooting/linux.md#cannot-access-docker-containers-over-meshnet).
{% endhint %}

### Method 1: Using an internet browser

The easiest way to manage your Home Assistant remotely is via an internet browser.

1. Copy the Nord name of the device running Home Assistant from the NordVPN app.
2. Open your internet browser.
3. Paste the copied Nord name followed by `:8123/` to the URL field and press **Enter**.\
   &#x20;\
   **Example**\
   `secret.meerkat-himalayas.nord:8123/`

   &#x20;
4. Log into your Home Assistant account.

   <figure><picture><source srcset="/files/cnRIr3oqO94pTWUGn6Fr" media="(prefers-color-scheme: dark)"><img src="/files/49m60sZDJreGMfO3AVNm" alt=""></picture><figcaption></figcaption></figure>

The Home Assistant dashboard will load, and you will have full control over it from your internet browser.

<div align="left"><figure><picture><source srcset="/files/pgv3UwVybuQEJzTn1863" media="(prefers-color-scheme: dark)"><img src="/files/kPqELyTWkQXXuXMqdu5G" alt="Home Assistant dashboard"></picture><figcaption></figcaption></figure></div>

### Method 2: Using the Home Assistant companion app

You can also access the Home Assistant dashboard remotely through the companion app. However, it is currently available only on Android, macOS, and iOS.

{% tabs %}
{% tab title="Android" %}

1. Download and install the [Home Assistant app](https://play.google.com/store/apps/details?id=io.homeassistant.companion.android) from the Google Play Store.
2. Copy the Nord name of the device running Home Assistant directly from the NordVPN app.
3. Open **Home Assistant** and tap **Continue**.
4. Select **Enter address manually**.
5. In the **Home assistant URL** field, type `http://` and paste the Nord name of the device running Home Assistant, followed by `:8123`. Tap **Connect**.

   <div align="left"><figure><picture><source srcset="/files/AuTI4poRFIlwgKOLvxfv" media="(prefers-color-scheme: dark)"><img src="/files/g9T8pm54SHsWa5RLLDpk" alt="Nord name entered in the Home Assistant application." width="375"></picture><figcaption></figcaption></figure></div>

   &#x20;
6. Log into your Home Assistant account.
7. Choose the name of your device, select the notification preferences, and tap **Continue**.

Once the setup process is complete, you will have full access to your Home Assistant dashboard using the mobile companion app.
{% endtab %}

{% tab title="macOS" %}

1. Download and install the [Home Assistant app](https://apps.apple.com/us/app/home-assistant/id1099568401) from the macOS App Store.
2. Copy the Nord name of the device running Home Assistant directly from the NordVPN app.
3. Open **Home Assistant** and click **Continue**.
4. Click **Enter address manually**.
5. Under **Enter URL**, type `http://` and paste the Nord name of the device running Home Assistant followed by `:8123`. Click **Connect**.

   <div align="left"><figure><img src="/files/nGofOgxtJURtP30cpva7" alt="Nord name entered in the Home Assistant application"><figcaption></figcaption></figure></div>

   &#x20;
6. Log into your Home Assistant account and configure the permission and notification preferences.

Once the setup process is complete, you will have full access to your Home Assistant dashboard using the companion application.
{% endtab %}

{% tab title="iOS" %}

1. Download and install the [Home Assistant app](https://apps.apple.com/us/app/home-assistant/id1099568401?itsct=apps_box_badge\&itscg=30200) from the iOS App Store.
2. Launch **Home Assistant** and select the app's permissions that you are comfortable with.
3. In the lower-right corner, tap the gear bubble and select **Add server**.
4. If you receive a dialog asking for permission to find local devices, choose **OK**.

   <div align="left"><figure><picture><source srcset="/files/fV5ovxhEI1rqmETEVNIf" media="(prefers-color-scheme: dark)"><img src="/files/ZnRXELVWYcug0nvc770S" alt="iOS system message regarding local connections" width="272"></picture><figcaption></figcaption></figure></div>

   &#x20;
5. Tap **Enter address manually**.
6. Type `http://` and paste the Nord name of the device running Home Assistant, followed by `:8123`. Then, tap **Connect**.

   <div align="left"><figure><img src="/files/3XrkA0nsihjalLBSF091" alt="Nord name entered in the Home Assistant application." width="375"><figcaption></figcaption></figure></div>

   &#x20;
7. Log into your Home Assistant account.

Once the setup process is complete, you will have full access to your Home Assistant dashboard using the mobile companion app.
{% endtab %}
{% endtabs %}

You have successfully configured Home Assistant and can now access its dashboard remotely with the help of Meshnet.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://meshnet.nordvpn.com/how-to/remote-access/home-assistant.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
