Docker + HA + Addons - HASSIO Supervisor

@juan11perez Thanks for providing your docker-compose file. It’s a great set of examples.

Like the OP, I installed HA via docker. A couple of places, the docs mention “addons are not supported except with the HassOS install method, but you can do it manually”. Those places don’t say how to do it manually. I was imagining it was by running the addons as docker containers and stitching them together, but I haven’t found any explicit documentation of that so far. Your info and examples show me what I need. It would be soooo handy if the HA docs gave at least a hint of what’s needed for “manually”.

Thanks again.

1 Like

I couldn’t find that quote in the documentation. What I did find is this:

the software from the add-ons may still usually be installed manually like any other program.

What that is saying is the software from the Node-Red Add-on can be installed manually. You can install Node-Red manually either as a Docker container or as an npm module.

Add-ons are curated applications that are packaged as customized docker containers (customized for use with the Supervisor container that comes with Home Assistant or Home Assistant Supervised).

So if you install Home Assistant or Home Assistant Supervised and want Node-Red, the easiest way is via the Node-Red Add-on. However, if you install Home Assistant Container and want Node-Red then you install the uncustomized, general release of Node-Red as a docker container or as an npm module.

Sorry, my quoted phrase was really just a paraphrase from memory. What I was looking at was this page: https://www.home-assistant.io/addons/, which says:

Add-ons are only available if you’ve used the Home Assistant installer. If you installed Home Assistant using any other method then you cannot use add-ons (but you can achieve the same result manually).

So, if I want to install the “Configurator” file editor manually, I’m left wondering if I really know what I’m supposed to do. Maybe if I’m the only one wondering, I’m just being dense. It wouldn’t be the first time.

Thanks for the clarifying info you provided.

1 Like

The “File editor Add-on” is the Ace editor, which is an “embeddable code editor written in JavaScript”. It runs as a web app which means the Add-on contains the Ace editor hosted on a web server. All of this was put together by Frenck (i.e. he made a docker container with a web-server and the Ace editor and then customized it to work with the Add-on ecosystem).

I googled “Ace editor docker” and got some hits but I can’t attest to the usefulness of the results. Let’s just say that you picked an Add-on that isn’t commonly found as a general-release docker container (like Node-Red, mosquitto, Samba, etc).

Almost every add on is found as a docker, which you can install yourself.
If you want a webserved editor try cloud9, which I use.
The doctor compose is in my file.

Update on what I’ve been working on…

I finally got an IntelNUC (NUC5i7RYH) on eBay so have gone to that running Ubuntu 20.04.

@juan11perez, I’ve been going through your docker file. So much more available than I ever thought!

I haven’t created my own docker-compose yet - I’ve just been doing docker run commands for now as I sort this all out and figure out what I want to run.

I have home-assistant running using mysql (mariadb). I have (had) a bunch of addons working and added them to the left-hand panel_iframe. It was all working well.

Then I switched off the old HASSOS system and moved to using the IntelNUC. When I changed the configuration to use my SSL certificate and domain then I lost my addons. HA works fine internally and externally. I even copied over the lovelace config and pointed all the devices and HA to the new MQTT container. But when I click on the icons for any of the addons I get nothing. Doesn’t even try and load them. I can only access HA via HTTPS now so I have a hunch that is the culprit. Event if I just try to access via the local hostname the addons won’t load. They do load independently via the local hostname and their listening ports but not via HA.

Is there something I need to do differently for the addons to work via HTTPS? They were working before when I was accessing using local address and HTTP.

Thanks!

sorry cant help with what’s now “Home Assistant”. I dont use that.
I run straight Home Assistant Container. The docker in my docker-compose substitute alll the addons.

I suspect that to see them externally (via https) you need to modify the addon configuration in HA to include a path to the certificate etc.

Right, that’s where I’m at. I’m running just the home-assistant container plus all the addons are independently run as containers as well with their ports exposed.

I added lines to the configuration.yaml to have icons show up in HA:

panel_iframe:
  configurator:
    title: 'Configurator'
    url: 'http://10.170.0.53:3218'
    icon: mdi:wrench-outline
  portainer:
    title: 'Portainer'
    url: 'http://10.170.0.53:9000'
    icon: mdi:docker

I tried changing them to https:// urls but then I actually get sad face icon (Chrome) that says bad response since they don’t actually support SSL.

I’ll keep messing with it. Worst case scenario I could always run the supervisor container then I can do the addons that way.

Not a bug, but something to consider. If you run HA under https:// , all iframes need to be https:// . So you need to make sure your other containers support https too. You can always install nginx to force them.

@francisp, funny you should mention that. I was reading about people using nginx (prior to the Let’s Encrypt addon I presume but maybe not).

I also found this error in my browser which corroborates your response:

Mixed Content: The page at ‘https://somewhere.duckdns.org:8443/portainer’ was loaded over HTTPS, but requested an insecure frame ‘http://10.170.0.53:9000/’. This request has been blocked; the content must be served over HTTPS.

I’ll have to figure out if they can be accessed via https.

…and/or figure out how to use nginx instead (which might be easier than trying to track down all the containers)

I got it working using something I already had: the Let’s Encrypt container.

I followed @juan11perez setup guide at: Nginx Referse Proxy Setup Up Guide - Docker

It required setting up the use of subdomains instead of folders. Works like a charm now.

Thank you!

1 Like

Thank you for sharing this detail. Helps cut through the confusion.

1 Like

WOW a very long list for a docker compose. A complete set… I did use some mixed and docker and its also work. Currently running synology and RPI, but it should not be too far from ubuntu either. Maybe time for me to create a helping guide.

2 Likes

Awesome work.
I recently started my setup and I am sticking with pure docker and was kind of lost for some until whole understanding of HA and hass.io
I will be setting up by docker without supervise.

1 Like

@juan11perez I tried to open your docker-compose file from the hastebin.com link but it only shows an empty file. Is this file expired or deleted? Tried differerent browsers and no-content-blockers but it’s always empty. Would be great if you could share it again :slight_smile:

Rene, i posted a link to a dropbox file at the end of my original post . I’ve added a number of dockers I use.

1 Like

Hi Unfortunately I get the same as ReneM and the file is empty for me as well.

Ignore me :slight_smile: I have just found the drop box line. Thanks

1 Like

I wanted to go HASS + HA via Docker-Compose, here is what I used:

WD=/opt/hassio
mkdir -p $WD/{setup}
cd $WD/setup
cat << 'EOF' >docker-compose.yaml
version: '3.7'
services:
  hassio_supervisor:
    container_name: hassio_supervisor
    image: "homeassistant/amd64-hassio-supervisor"
    privileged: true

    volumes:
      - type: bind
        source: ${SUPERVISOR_SHARE}
        target: /data
      - type: bind
        source: /etc/machine-id
        target: /etc/machine-id
      - type: bind
        source: /etc/localtime
        target: /etc/localtime
      - type: bind
        source: /run/docker.sock
        target: /run/docker.sock
      - type: bind
        source: /run/dbus
        target: /run/dbus
      - type: bind
        source: /dev/bus/usb
        target: /dev/bus/usb

    security_opt:
      - seccomp:unconfined
      - apparmor:hassio-supervisor

    environment:
      - SUPERVISOR_SHARE=/opt/hassio
      - SUPERVISOR_NAME=hassio_supervisor
      - HOMEASSISTANT_REPOSITORY=homeassistant/qemux86-homeassistant
      - DBUS_SYSTEM_BUS_ADDRESS=unix:path=/var/run/dbus/system_bus_socket
EOF
chmod +x docker-compose.yaml

More rambles here https://www.freesoftwareservers.com/display/FREES/Home-Assistant+-+Supervised+-+HASSIO+-+Docker-Compose

2 Likes