HA Container - Unable to External Access

Hello, I am trying to get external access to work on my HA Container installation in Raspbian Pi 4. I am able to access it from the local network but not externally.

I am forwarding ports 80, 443, and 8123 at my router to Pi IP. I am able to reach other services running on the Pi just to confirm the port forwarding is working.

I am currently trying DuckDNS.org and just plain SSL without luck. Also tried disabling SSL, but same result.

  GNU nano 5.4                     /var/lib/docker/volumes/Home-Assistant/_data/configuration.yaml                              

# Loads default set of integrations. Do not remove.
default_config:

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

#Networking!
homeassistant:
  external_url: "https://mysubdomain.duckdns.org"
  internal_url: "http://mysubdomain.duckdns.org:8123"

# Example configuration.yaml entry
duckdns:
  domain: mysubdomain.duckdns.org
  access_token: mytoken

http:
  server_port: 8123
  ssl_certificate: /config/ssl/fullchain.pem
  ssl_key: /config/ssl/privkey.pem

That’s not going to work, you’re using SSL in HA, so you have to use https:// always.

Did you forward port 443 on the router to port 8123 on HA, or to port 443 on HA?

Yes, 443–>443, 8123–>8123

Not sure what else you have running but it seems like both your internal and external URLs are wrong.

That’s not right since HA is listening on port 8123 according to your config and you have port 8123 forwarded to 8123. It should be https://mysubdomain.duckdns.org:8123.

That won’t work for the reasons tinkerer said. You specified SSL options in HA so therefore you must always talk to HA using SSL, internal and external.

Since you are also forwarding ports 443 and 80 to the same machine and HA isn’t listening on either of those it seems like you might have a reverse proxy running on the same machine. If so you should remove the ssl certificate and key from HA’s config and let the reverse proxy handle that. Then everything will work fine.

If you don’t have a reverse proxy then your URLs are wrong.

1 Like

I am not running a reverse proxy, just straight port forwarding. Port Forwarding is working since I tested it for other services on the same Pi.

I made the URL changes, and still it HA is not externally accessible

  GNU nano 5.4                     /var/lib/docker/volumes/Home-Assistant/_data/configuration.yaml                              

# Loads default set of integrations. Do not remove.
default_config:

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

#Networking!
homeassistant:
  external_url: "https://mysubdomain.duckdns.org:8123"
  internal_url: "https://mysubdomain.duckdns.org:8123"

# Example configuration.yaml entry
duckdns:
  domain: mysubdomain.duckdns.org
  access_token: mytoken

http:
  server_port: 8123
  ssl_certificate: /config/ssl/fullchain.pem
  ssl_key: /config/ssl/privkey.pem

Then, given (as Mike said), HA listens on port 8123, you have to use that when connecting.

That or change the port forwarding to forward 443 to 8123.

That the port I am using to connect, it is built in to the URL: https://mysubdomain.duckdns.org:8123

I tried forwarding 443 to 8123 and it makes no difference.

Then I’d suggest you follow this guide and check that you’ve gone through all the steps. That covers many common problems too.

Thank you! The external port testing tool helped identify my problem!

1 Like