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.3.6.0923 and 2.0.117 respectively), 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 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 the container, in my case this directory is a share on the nas called ‘/Container/hass_config’. Hands on with the first method, in my opinion the most simple, 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’, do not forget to put the ip of your nas instead of the x‘s.
And now the GUI method, using Container Station from your nas, here are the steps to follow:
- 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.
In order to update your Home Assistant instance, just remove container and image and reinstall it again, configuration should be kept in ‘/Container/hass_config’.