Home Assitant - zbrewer/homelab GitHub Wiki

Installation

Home Assistant can be installed in a number of ways, including on dedicated Home Assistant manufactured hardware or on a dedicated Raspberry Pi; however, in order to make the best use of existing hardware and simplify backups, I chose to install it on a Proxmox server.

There are a number of ways this can be done as well, including in a Docker container or on a Debian VM with a supervised install. That being said, I chose to install Home Assistant OS (HAOS) in a VM as this gave the best feature set. See this table for a feature comparison.

While this installation can be performed manually, the easiest way is to use one of the scripts from tteck on GitHub. The source can be found here and the command to run the script is given below. Also, check out their github.io site at https://tteck.github.io/Proxmox/ for more information.

$ bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/vm/haos-vm.sh)"

The source is worth taking a look at to see the steps performed but the script prompts the user for a basic or advanced installation and, if advanced is chosen, lets a number of parameters be configured including VM ID, CPU/RAM allocated, network bridge, MAC address (useful for providing a DHCP reservation), VLAN, and more.

Once installed and started, go to http://<vm_id>:8123 to view the web UI.

Reverse-Proxy Setup

After the basic install is completed and a home is either created or imported, the configuration will need to be updated slightly to allow requests from reverse proxies (otherwise you will see 400 errors).

See the Home Assistant documentation for instructions here for editing the configuration.yaml file and the instructions here for NGINX (step 9 - Configure Home Assistant specifically) for details of the changes to make. The basic steps are to:

  1. Install the File Editor add-on by going to Settings > Add-ons, going to the store page, and looking for File Editor under the Official add-ons section. Click Install and then Start.
  2. Open the File Editor add-on and open the configuraion.yaml file in the /config/ folder.
  3. Add the following lines to the bottom of the configuration file:
    http:
      use_x_forwarded_for: true
      trusted_proxies: <reverse_proxy_ip>
    
    Where <reverse_proxy_ip> is replaced with the actual IP of your reverse proxy.
  4. Follow the instructions here to reload the changes in Home Assistant by going to the Developer Tools tab and clicking CHECK CONFIGURATION under the Check and restart heading. Correct any errors present and then click the RESTART button in the Developer Tools tab.

Home Assistant should now be reachable via reverse proxy.

⚠️ **GitHub.com Fallback** ⚠️