Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[GUIDE] Reverse proxy Home Assistant VM with Traefik

Featured Replies

You want to access your Home Assistant VM remotely ? eg : with your phone companion app

So simple, but couldn't find guide anywhere 😔 ! So here we are !

It's basically Home Assistant Cloud for free.

You will "simply" need to reverse proxy home assistant virtual machine with Traefik on Unraid ! 🥸


You must already :

  • configure Home Assistant with a Fixed IP.
  • have a domain or a DDNS setup
  • have attributed a subdomain to point to home assistant
  • have successfully reverse proxied a service/docker (so you don't start with HA's VM)
  • MUST ABSOLUTELY have set up a double auth middleware (so you don't expose your HA VM to the rest of the world).

 

I won't provide support for these steps. Ibracorp videos are a good starting point.

I personally use ddns-updater, Cloudflare and Authelia.

 

On Home Assistant, edit your configuration.yaml (with the file editor HA plugin) :

 

homeassistant:
    external_url: "https://subdomain.domain.com" # provide your subdomain and domain, with no port
    internal_url: "http://homeassistant.local:8123" # local address with port

    
http:
    use_x_forwarded_for: true
    ip_ban_enabled: false
    trusted_proxies:
        - 192.168.X.X/24 # replace X to fit your local devices

 

On Traefik, edit fileConfig.yml, to include under "http:", and edit the following :

  • subdomain
  • domain
  • localip
  • localport
  • auth (if not already named auth, must be replaced with the identifier of your middleware)

 


  ## EXTERNAL ROUTING - Only use if you want to proxy something manually ##
  routers:
     HomeAssistantRouter:
       entryPoints: https
       rule: "Host(`subdomain.domain.com`)"
       service: HomeAssistantService
       middlewares:
         - auth

  ## SERVICES ##
  services:
     HomeAssistantService:
       loadBalancer:
         servers:
           - url: http://localip:localport

 

 

Then go check on Traefik's UI to see if there's any error being reported. It should be all green.

You'll just need to log on your Auth service before logging in Home Assistant. I tried from the Companion's app and it worked perfectly with Authelia.

 

You are now set, enjoy the automations ! 👏

 

42045278_Screenshot2023-10-08at15_27_16.thumb.jpg.537357dd08b3aeb8428fbcdada336878.jpg221674073_Screenshot2023-10-08at15_25_23.thumb.jpg.75f8b327f4ca0c4f4a5591436ec8e22a.jpg

Screenshot 2023-10-08 at 15.14.25.jpg

Edited by dboris
update pictures

  • Slasheal changed the title to [GUIDE] Reverse proxy Home Assistant VM with Traefik
  • 2 months later...

Hi @dboris. Thanks for this guide.
I'm having a strange issue.

 

Traefik is set up and working pointing at other docker images, and other standalone servers on my network. So I know it's working properly.

 

The problem is, whenever I enable the homeassistant and http settings in configuration.yaml on the HA side I'm unable to get the UI to load at all. It doesn't work from the normal local url or ip address url.  I end up having to SSH in and edit the yaml file to remove those settings.

 

When I look at HA in the VNC console there are no errors and none in the logs.

Did you run into anything like this? 

 

  • 2 weeks later...

Setup a cloudflare tunnel and install the cloudflare addon in HA. I just tried setting up a tunnel into my unraid with a redirect to ha instance and I couldn't get it to work. There was some issue with HA not responding to reverse proxy requests. I don't know enough about it so went with direct tunnel into my ha instance and using the addon inside ha. So in cloudflare I have a tunnel to my unraid server (for radarr and sonarr) and a separate one for ha. On thing I am trying to setup is 2 factor authentication but haven't been able to get that running with the android app yet. I have it running on my unraid tunnel so that cloudflare asks for an email to send an authentication code before you can get to the logon screen for the app. 

  • 2 weeks later...
  • Author
On 1/27/2024 at 12:29 AM, GollyJer said:

Hi @dboris. Thanks for this guide.
I'm having a strange issue.

 

Traefik is set up and working pointing at other docker images, and other standalone servers on my network. So I know it's working properly.

 

The problem is, whenever I enable the homeassistant and http settings in configuration.yaml on the HA side I'm unable to get the UI to load at all. It doesn't work from the normal local url or ip address url.  I end up having to SSH in and edit the yaml file to remove those settings.

 

When I look at HA in the VNC console there are no errors and none in the logs.

Did you run into anything like this? 

 


No I don't face this issue. :/

 

2 factor authentication worked for me on my mobile : had to log in manually on authelia. Once done, still working today.

  • 8 months later...

Sorry for the revival comment, but wondering if you would know how to get this working with Swag? Keep getting an ERR_SSL_PROTOCOL_ERROR

 

I think there's something with the configuration of the VM but can't work out what it is

  • Author

I can't help you with swag unfortunately.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.