Add HA supervised on server with traefik + letsencryt and multiple existing services

Hi all,

I start with home assistant and for some time now I’ve been trying to install it on a raspberry pi4 with ubuntu server 20.10 where there are already several dockers :

  • nextcloud
  • ghost
  • apache+php for my custom applications
  • mariadb

all behind traefik + letsencrypt using docker-composer

I made a first try by adding in docker-composite home assistant and after some configuration tests by adding labels I succeeded in making home assistant work successfully in https in a sub-domain.

But as a beginner in home assistant I thought that the supervisor would facilitate my beginnings.

So I used the installer https://github.com/home-assistant/supervised-installer.

The installation went well I can access HA with myIP:8123 or sub.domain:8123 but I don’t understand how to configure traefik to access with “https”://sub.mydomain as I did with docker-composer.

I tried to add the necessary labels in the homeassistant container but it doesn’t work.

So my questions :

  • is there a way to install HA supervised with a docker-compose-based method ?
  • or do you have an example configuration of traefik + letsencrypt that works with homeassistant/supervised-installer ?

Thank you in advance for your help, because I’m running out of ideas …

Have you figured this out? I have the same question. I’m able to install non-Supervised Home Assistant container and get that working with Traefik. But I was hoping to move to Supervised to have the Add-On store and easy backups.

I solved my problem as follows:

Before :

  [http.routers.api]
    rule = "Host(`traefik.mydomain.com`)"
    entrypoints = ["websecure"]
    middlewares = ["simpleAuth"]
    service = "[email protected]"
    [http.routers.api.tls]
      certResolver = "lets-encrypt"

After :

[http.routers]
  [http.routers.api]
    rule = "Host(`traefik.mydomain.com`)"
    entrypoints = ["websecure"]
    middlewares = ["simpleAuth"]
    service = "[email protected]"
    [http.routers.api.tls]
      certResolver = "lets-encrypt"
  [http.routers.ha]
    rule = "Host(`homeassistant.mydomain.com`)"
    entrypoints = ["websecure"]
    service = "ha"
    [http.routers.ha.tls]
      certResolver = "lets-encrypt"


[http.services]
  [http.services.ha]
    [http.services.ha.loadBalancer]
      [[http.services.ha.loadBalancer.servers]]
        url = "http://myLocalIp:8123/"

with this configuration I can access home assistant from outside with https://homeassistant.mydomain.com
and from my local network with
http://my_local_ip:8123

a traefik expert might find fault with it, but for me it meets my needs.

I hope it can help you

@fbollon I am new with traefik and I want a similar install as you did. Any chance we could get in touch or your could share your full docker-compose as well as other configs plz.

Thanks