After spending quite a time, trying to set this up I have come down to the following things that worked for me, maybe it will help someone:
Duckdns
First create a duckdns account and setup the DuckDNS addon. If you have your own domain you can add a subdomain A record to resolve to your public IP and not use DuckDNS at all.
in duckdns addon configuration add your duckdns Domain e.g. my.ducksdns.org and set the token
Router
Forward Port 80 on Router to Port 80 homeassistant IP. This is required for letsencrypt. Otherwise you might not be able to obtain a certificate.
Forward Port 443 on Router to Port 443 homeassistant IP
Home Assistant
In your configuration.yaml
1 2 3 4 5 6 7 | http: ip_ban_enabled: true login_attempts_threshold: 5 use_x_forwarded_for: true trusted_proxies: - 10.0.0.200 # Add the IP address of the proxy server - 172.30.33.0/24 # You may also provide the subnet mask |
Nginx Proxy Manager
Now add the domain in Nginx Proxy Manager, set
- domain to my.ducksdns.org
- scheme to http
- forward hostname/ip to homeassistant.local or 192.168.x.x (this should be the IP of your homeassistant)
- port to 8123
- enable websockets support
On SSL tab, select Request a new SSL certificate
, select Force SSL
and click save That should be it, now your homeassistant should be accessible at https://my.ducksdns.org
Home Assistant
In home assistant settings > system > network > Home Assistant URL set the https://my.ducksdns.org there.