Here is the procedure to install an instance of Home Assistant on your Qnap NAS. We will install it as a docker container, using Container Station provided by QNAP.
I have only test this procedure in my QNAP TS-453be, with the latest versions of QTS and Container Station (4.4.3.1381 and 2.1.3.1360 at time of writing). Iām not sure if it would work on different hardware or with different versions of software, although in the newer versions with docker support it should be quite straightforward.
I will show you two methods to obtain the same result, one through the CLI and another from the QTS graphic interface. First of all there is a small requirement. We need access to a directory outside the container where we will store the configuration of Home Assistant to not lose it if we update or delete the container. In my case this directory is a share on the nas called ‘/Container/hass_config’.
Command Line Interface method (CLI)
In my opinion this is the simplest method. Connect to the nas by ssh as administrator and execute the following command:
docker run --init -d --name="home-assistant" -v /Container/hass_config:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/home-assistant:latest
Neat and easy, isn’t it? After a while, you can access your Home Assistant instance in the url ‘http://xxx.xxx.xxx.xxx:8123’. You will be presented with Home Assistant onboarding page. Do not forget to put the ip of your nas instead of the x‘s.
Graphic User Interface method (GUI)
And now the graphic method, using Container Station from your nas. Here are the steps to follow:
- Log in into the Qnap web interface.
- Open ‘Container Station’ and select create.
- Search for “homeassistant”, find the ‘homeassistant/home-assistant’ image on the Docker Hub results tab and click ‘Create’.
- Select version, and set the name and resources for the container as per your requirements.
- Under ‘Advanced Settings -> Environment’ create a variable named tz with your timezone as value (e. Europe/Madrid).
- Under ‘Advanced Settings -> Network’ select Host as Network Mode.
- Under ‘Advanced Settings -> Shared Folders’ you should add a directory from your nas (host) as stated before or create a new one, use /config as mount point.
And that’s it, some time after clicking ‘Create’ you should be able to access your Home Assistant instance in the url ‘http://xxx.xxx.xxx.xxx:8123’. Replace the ip of your nas with the x‘s.
We have seen how to easily install Home Assistant in a QNAP nas. In order to update your Home Assistant instance, just remove container and image and reinstall it again, configuration will be kept in ‘/Container/hass_config’.