Setting Up DuckDNS in Home-Assistant.IO
This quick tutorial lets you walkthrough how to setup the DuckDNS in your Home Assistant.IO.
I am using Home Assistant.IO installed on my Raspberry Pi 4 sitting at my home and I would like to access my Home Assistant portal remotely when I am away from home. With DuckDNS, I can access your Home Assistant remotely.
Go to www.duckdns.org and logon using your preferred credential method. Once you logged on, add a domain and take note the token information. We will be using this token to configure the DuckDNS in Home Assistant.
Also take note the domain information you created (e.g., https://myhomeassistant.duckdns.org). You will be using this information to access the Home Assistant remotely.
Go to Supervisor and Add-on Store and search for Duck DNS.
After you have installed, go to Configuration.
Fill in the token information, add the domain you created from DuckDNS (e.g., https://myhomeassistant.duckdns.org) and set accept_terms to true. Then save it.
Start the DuckDNS and go to Log tab. Ensure there is no error message and the certificate is created.
Go to Terminal (install if you don’t have one) and go to /ssl and check if fullchain.pem and privkey.pem are there.
We are good now for DuckDNS configuration in Home Assistant.
Now we need to configure the port forwarding in the router. The incoming traffic from DuckDNS with port 443 (HTTPS) will be routed to Raspberry Pi Home Assistant IP address with port 8123. I have reserved the static IP address for the Raspberry PI (in my case is 192.168.0.109).
Before we can test the access remotely, go to Home Assistant and go to Configuration, General. Fill in the External URL with your DuckDNS domain URL (e.g., https://myhomeassistant.duckdns.org) and Internal URL with your Raspberry PI IP address.
The last step is to update the configuration.yaml and add the following lines:
Now restart the Home Assistant.
If everything is successful, you now can access the Home Assistant from the DuckDNS domain you created (https://myhomeassistant.duckdns.org). Don’t forget to put prefix HTTPS.