Networking and remote access
Make Home Assistant reliable on your local network before exposing it remotely. Configure a stable address, compare four secure remote-access paths, and apply the security rules that must not be skipped.
Why remote access is so easy to get wrong
Appendix A compares the four remote-access options and helps you choose one. This chapter explains how to implement that choice—and what can go wrong.
The stakes are higher here than in the preceding chapters. A broken automation might leave a light off. A broken remote-access setup can expose your home to the entire internet.
Home Assistant can reveal occupancy in every room, door and window states, camera feeds, smart-lock controls, and the times you leave and return. Someone who gains access has effectively copied your house key. That is why this chapter follows a deliberate order: stabilize the local network before configuring external access. Many people skip the first step, then find that even access from home is unreliable.
By the end of this chapter, you will be able to:
- Reserve a permanent IP address for the Home Assistant host on your router
- Understand why
homeassistant.localworks sometimes, why it may fail, and what to use instead - Choose one of four remote-access options and complete its setup
- Understand the two reverse-proxy settings required for successful sign-in
- Recognize what you must never do, including the common advice to “forward port 8123”
configuration.yaml file's http: block is being deprecated. This chapter uses the new UI locations first and shows the old YAML method only for earlier releases. If your version predates 2026.8, your screens will differ; the relevant sections note this explicitly.LAN basics: IP, DHCP, and why the address must stay fixed
The easiest analogy is an apartment building's street addresses.
Your router is the building manager. It gives every device connected by Wi-Fi or Ethernet—a phone, laptop, television, or Home Assistant host—an address such as 192.168.1.37. This is an IP address.
The process of assigning addresses is called DHCP. It happens automatically, which is convenient, but has one crucial property: the address is leased, not owned.
A lease expires. Your Home Assistant host may be 192.168.1.37 today, receive 192.168.1.52 after restarting following a power outage, and leave .37 to your new robot vacuum.
What breaks when the address changes
| What breaks | Symptom |
|---|---|
| Your browser bookmark | The page keeps loading, then reports that it cannot connect |
| The mobile app's internal URL | Access fails at home even though cloud access works while you are away |
| Port-forwarding rules on the router | The rule still points to the old address—and therefore the wrong device |
| Reverse-proxy configuration | The proxy cannot find its backend and returns a 502 error |
| Integrations connected by IP | Printers, NAS devices, and cameras become unavailable |
| URLs in your own automations | The automation fails silently without displaying an error |
The rule is simple: the Home Assistant host must have a fixed IP address. This is not an advanced technique; it is an essential prerequisite.
Two ways to fix an IP address—and which to choose
| Method | Configured on | Assessment |
|---|---|---|
| DHCP reservation (reserved address) | Router | Recommended. The router remembers to assign this address to this host. Nothing changes on the host, and the reservation survives replacing an SD card or reinstalling Home Assistant |
| Static IP on the device (static IP) | Home Assistant host | It works, but you must enter the gateway, subnet mask, and DNS server yourself. One incorrect field can make the host unreachable and require a monitor and keyboard to repair. The router may also assign the same address elsewhere because it does not know the host has claimed it |
Learn to identify the MAC address
Before making a reservation, the router must identify which device is Home Assistant. It does so by its MAC address—an identifier assigned to each network interface, such as DC:A6:32:1B:4E:F0.
The IP address can change, but the MAC address does not. A reservation therefore tells the router: “Whenever the device with this MAC address requests an address, always assign 192.168.1.37.”
Hands-on: reserve the host's IP and verify the network page
-
Find the host's IP and MAC addresses
Go to Settings → System → Network. This page lists the host's wired and wireless network interfaces and their current IP addresses. Record the relevant IP.
The MAC address may not appear here. The easiest place to find it is the router's connected-device list. Open the router's administration page and find the device named
homeassistant, or the device whose IP matches the one you just recorded. Its MAC address should appear alongside it. You will already be in the right place for the next step. -
Sign in to the router's administration page
The router's administration address is often
192.168.1.1or192.168.0.1, and it may be printed on a label underneath the router. The credentials may be there too. If you have never changed the default password, change it now; every later security measure depends on it. -
Find the DHCP reservation page
Manufacturers use different names, making this the most difficult step. Look for Reserved Address, DHCP Reservation, Address Reservation, Static DHCP, Static Lease, or Fixed Assignment. It is usually under “Local Network / LAN” or “Advanced Settings → DHCP Server.”
If you cannot find it, search for your router model plus “DHCP reservation.” Even inexpensive home routers usually support the feature, although it may be buried in the interface.
-
Add a reservation
Enter the MAC address from step 1 and choose the IP to assign. Pick something memorable and unlikely to collide, such as
192.168.1.10. Enter “Home Assistant” in the description field; your future self will appreciate it.Save the setting. Some routers must restart before it takes effect.
-
Renew the host's address
The host will not switch immediately after you create the reservation; its old lease remains valid. The quickest method is to restart the Home Assistant host (Settings → System, open the power menu in the upper-right corner, then choose Restart system), or disconnect and reconnect its Ethernet cable.
-
Verify the result
After the restart, return to Settings → System → Network and confirm that the displayed IP is the address you reserved. Open Home Assistant at the new address and sign in. Replace your old bookmark with this URL.
-
Set the internal URL
On the same Settings → System → Network page, find the Internal URL and External URL fields. Set the Internal URL to the address you reserved, for example
http://192.168.1.10:8123.For both fields, stop after the port; do not append a path. A value such as
http://192.168.1.10:8123/lovelacecan cause features that generate links to produce malformed URLs.
Understanding homeassistant.local and port 8123
The technology behind .local addresses is mDNS
When you first installed Home Assistant, the instructions may have told you to open homeassistant.local:8123. It worked even though you had not configured a DNS server at home. How did the computer know where that name led?
The answer is mDNS (Multicast DNS). In plain language, it works like calling out to everyone in a room:
-
Your computer sends a multicast query across the LAN
“Is any device named homeassistant?” Every device on the same network segment can hear the query.
-
The Home Assistant host responds
“That's me. I am at 192.168.1.10.”
-
Your computer records the answer and connects directly
No central server is required. Apple calls its implementation Bonjour; Linux commonly uses Avahi. Both implement the same underlying concept.
Why it often fails
Several conditions can block that local multicast exchange:
| Cause | How to identify it | Solution |
|---|---|---|
| You and the host are on different network segments, such as a VLAN or guest network | The phone works on the primary Wi-Fi but not on guest Wi-Fi | Connect directly by IP, or enable mDNS forwarding on the router |
| The router or switch blocks multicast traffic | No device at home can resolve .local, but direct IP access works | Check the router's IGMP Snooping, Multicast, and mDNS settings, or use the IP address |
| Wi-Fi client isolation is enabled | The phone can access the internet but cannot reach any local device | Disable AP Isolation or Client Isolation on the router |
| The operating system or browser does not support it | This can occur with some Android versions or on managed enterprise networks | Use the IP address |
| You are away from home | It always fails after you leave | mDNS only works on the local network by design; nothing is broken |
| Two devices are both named homeassistant | The address opens the wrong host | Rename one of them |
homeassistant.local will never resolve from the public internet. It is not a public URL and cannot be used for port forwarding.Port 8123 and the change in 2026.8
If the IP is a street address, a port is the extension number at that address. One host can run many services at once, and ports distinguish them. Home Assistant has traditionally used 8123, hence http://192.168.1.10:8123.
Version 2026.8 introduced an important change:
| Situation | Default port | Example URL |
|---|---|---|
| A fresh Home Assistant OS installation on 2026.8 or later | 80 | http://homeassistant.local (no port number needed) |
| A system installed before 2026.8 and then upgraded | Remains 8123 | http://homeassistant.local:8123 |
| Container / Docker installation | 8123 | http://192.168.1.10:8123 |
The release notes are explicit: nothing changes on an existing system, and you do not need to take any action. The new default affects only fresh Home Assistant OS installations. The :8123 found in most online guides is therefore probably still correct for your system.
Why change it? Port 80 is the default for HTTP, so browsers add it automatically. The result is a shorter URL and one less obstacle for beginners.
Which of the four options suits you?
Appendix A introduces all four options. The table below is a decision aid: choose one, then proceed to its implementation section.
| Consideration | Nabu Casa | Cloudflare Tunnel | VPN (Tailscale / WireGuard) | DDNS + reverse proxy |
|---|---|---|---|---|
| Price | United States: US$6.50/month or US$65/year; European Union: €7.50/month or €75/year; United Kingdom: £6.50/month or £65/year; Canada: CAD 8.70/month or CAD 87/year; other regions: US$6.50/month. Registration includes a one-month free trial | Basic use is free, but you must provide a domain and pay its annual registration fee | Tailscale's free personal allowance is sufficient for home use; self-hosted WireGuard is free | Free DDNS plans and certificates are available; the principal cost is your time |
| Difficulty | Lowest; turn on one switch | Moderate; requires Cloudflare dashboard configuration | Low for Tailscale; medium to high for self-hosted WireGuard | Highest; requires router, DNS, certificate, and proxy configuration |
| Security | Good. Officially maintained, with no inbound port | Good. No inbound port, plus optional Cloudflare access controls | Best isolation. The interface is not public; only your authorized devices can connect | Depends on your configuration. Done correctly it is strong; done incorrectly it is the riskiest option here |
| Works behind CGNAT? | Yes | Yes | Tailscale does; self-hosted WireGuard does not | No. DDNS cannot provide inbound access through CGNAT |
| Voice-assistant integration (Alexa / Google) | Directly supported and included in the subscription | Technically possible, but you must configure the cloud integration yourself | No. Cloud voice services are outside your private VPN | Possible, but you must configure the cloud integration yourself |
| Sharing with family | Provide the URL and an account | Provide the URL and an account | Each person must install the VPN and join your network, which may challenge less technical relatives | Provide the URL and an account |
| Maintenance | Almost none | Low | Low | High. Certificates expire, IP addresses change, and proxies can fail |
Choose in thirty seconds
- You want the simplest setup, use Alexa or Google, and wish to support official development → Nabu Casa. Home Assistant documentation describes it as the simplest and most secure option for most people.
- Only you and a partner need access, you do not need a cloud voice assistant, and you want a free, secure option → Tailscale. It offers the strongest isolation.
- You already own a domain, want a polished custom URL, and need easy access for family → Cloudflare Tunnel.
- You want to learn networking, have a fixed or relatively stable public IP, and can devote a weekend → DDNS + reverse proxy.
Option 1: Home Assistant Cloud (Nabu Casa)
This subscription service is operated by the organization behind Home Assistant. Revenue directly supports development of Home Assistant, ESPHome, Z-Wave JS, and related projects. It is both the easiest option and the most direct way to fund the ecosystem.
What it does
Your host establishes an outbound connection to Nabu Casa's servers. External requests then travel through that existing connection. You do not open any inbound port on the router. This is why the service works behind CGNAT and remains unaffected when your public IP changes.
Setup
-
Find the cloud settings
Go to Settings → System → Network. Under “Home Assistant URL,” find the Internet section and enable “Use Home Assistant Cloud.” You can also use Settings → Home Assistant Cloud; both routes lead to the same place, so use whichever appears in your version.
-
Register or sign in
Register a Nabu Casa account with your email address. This is separate from your local Home Assistant account. You can begin the one-month free trial without paying first.
-
Enable remote access
After signing in, enable the remote-control switch. Home Assistant assigns you a permanent URL containing a long identifier followed by
.ui.nabu.casa, such ashttps://abcd1234-ef56-7890-abcd-ef1234567890.ui.nabu.casa.It is not memorable, but it is unique, stable, and protected by HTTPS.
-
Save the URL in the mobile app
Open the Companion App installed in Chapter 7. In the app settings, enter this address as the External URL. Keep the local IP as the Internal URL. The app will choose the appropriate address for the current network.
-
Test
Turn off Wi-Fi on your phone, use mobile data only, and open the app. If you can sign in, setup is complete.
127.0.0.1. IP banning therefore cannot distinguish individual cloud clients; banning that address effectively bans all cloud users. Nabu Casa users should rely on MFA rather than IP banning as the primary defense.home.yourdomain.com. This feature requires Home Assistant 2023.9.0 or later. Configure it in the Nabu Casa dashboard and add the corresponding record at your DNS provider.Option 2: Cloudflare Tunnel
The underlying idea matches Nabu Casa: your host initiates an outbound connection, so no inbound port is opened. Cloudflare operates the service, and it uses your own domain, allowing a polished custom URL.
Requirements
| Requirement | Details |
|---|---|
| Cloudflare account | The free plan is sufficient |
| A domain you own | This is mandatory, and its DNS must be managed by Cloudflare |
| Home Assistant OS or Supervised | The procedure installs an app (formerly called an add-on). Container users must run a separate cloudflared container |
Setup
-
Move the domain's DNS to Cloudflare
Add your domain in the Cloudflare dashboard. Cloudflare provides two nameservers. At the registrar where you bought the domain, replace the existing nameservers with those two values. Propagation may take a few minutes or several hours.
-
Add the third-party app repository
Cloudflared is not included in the default repository. Go to Settings → Apps (“Add-ons” in older versions) → Install app → the three-dot menu in the upper-right corner → Repositories. Paste
https://github.com/homeassistant-apps/repository, then select Add.Older guides may show
brenner-tobias/addon-cloudflared. That repository now states that the project moved to the homeassistant-apps organization, so use the current address above. Chapter 20 explains the complete process for third-party repositories. -
Install and configure Cloudflared
After adding the repository, find the new Cloudflared card and install it. On its configuration tab, enter the external address you want, such as
ha.yourdomain.com. -
Start the app and authorize it
Start the app, then open its log tab. The log displays an authorization URL. Open it in a browser, sign in to Cloudflare, and authorize the tunnel for your domain. Beginners often miss this step because the prompt appears in the log.
-
Configure trusted proxies
Traffic enters Home Assistant through the app container, which acts as an additional proxy layer. Home Assistant blocks those requests unless the proxy is explicitly trusted. Typical symptoms are a page that opens but will not accept your sign-in, or a full-page
400 Bad Request. Follow the “Trusted proxies” section below. -
Test
Turn off your phone's Wi-Fi and open
https://ha.yourdomain.comover mobile data.
Option 3: VPN (Tailscale or WireGuard)
The first two options put Home Assistant securely on the internet. A VPN takes a different approach: it brings your phone into your home network.
Think of the first two options as a door guarded by strict security. A VPN has no public door at all; only people with a key know how to reach the building. Because Home Assistant is never exposed to the public internet, this option provides the strongest isolation of the four.
Tailscale: the straightforward choice for beginners
Tailscale automates the difficult parts of a VPN, including key exchange, NAT traversal, and routing. It can even traverse CGNAT, which is essential for many connections worldwide.
-
Create a Tailscale account
Sign in with a Google or GitHub account. The free personal allowance is ample for a typical home.
-
Add the community app repository
Go to Settings → Apps → Install app → the three-dot menu in the upper-right corner → Repositories, then add
https://github.com/hassio-addons/repository. This is the Home Assistant Community Add-ons repository, now called Community Apps; it includes both Tailscale and WireGuard. -
Install and start Tailscale
Install and start the app, then open its log tab. Follow the authorization URL shown there to add this host to your Tailscale network.
-
Install Tailscale on your phone
Install the Tailscale app from the App Store or Play Store and sign in with the same account.
-
Connect through the Tailscale address
Once the VPN is connected, use Home Assistant's address on the Tailscale network. With MagicDNS enabled, it resembles
homeassistant.tail1234.ts.net, wheretail1234is assigned to your network.
advertise_routes setting that shares your home LAN subnet. When enabled, a phone connected to the VPN can reach not only Home Assistant but also your NAS, printer, and router administration page. This is particularly useful for maintenance.127.0.0.1, or sign-in may loop indefinitely. A direct VPN connection without Serve or Funnel does not require this step.WireGuard: the self-hosted alternative
WireGuard is the underlying technology used by Tailscale, but you host it and manage its keys yourself. The community app repository above (hassio-addons/repository) includes a WireGuard app.
| Tailscale | Self-hosted WireGuard | |
|---|---|---|
| Who manages keys? | Tailscale's coordination servers | You do, pairing each device manually |
| Inbound port required? | No | Yes. You must forward a UDP port on the router |
| Works behind CGNAT? | Yes | No |
| Third-party dependency? | Yes | No; you retain complete control |
| Adding a new device | Sign in to the account | Generate a key, edit the configuration, and restart |
The usual reason to choose WireGuard is simple: you do not want to depend on a third-party service. If that is not a requirement, Tailscale saves considerable time.
Option 4: DDNS + reverse proxy + Let's Encrypt
This is the most traditional, hands-on, and error-prone option. It combines three independent components, each solving a different problem:
| Component | Problem it solves | Analogy |
|---|---|---|
| DDNS Dynamic Domain Name System | Your public IP changes and is difficult to remember or share | When you move, DDNS automatically tells the post office your new address |
| Reverse proxy Proxy server | Accepts encrypted HTTPS traffic, decrypts it, and forwards it to Home Assistant | A building's reception desk receives every package, then sends it upstairs |
| Let's Encrypt | Issues free HTTPS certificates so browsers do not display warnings | A notary's seal confirms that the address belongs to you |
Three official apps
All three components are available in the official app repository, so you do not need to add a third-party repository:
| App | Purpose |
|---|---|
| Duck DNS | Maps your changing public IP to an xxx.duckdns.org address and includes Let's Encrypt certificate issuance, solving two problems at once |
| Let's Encrypt | Issues and renews certificates. Install it separately only when using another DDNS provider or your own domain |
| NGINX Home Assistant SSL proxy | Provides the reverse proxy. Its official description says it creates an SSL proxy with NGINX and redirects traffic from port 80 to 443. Note that port 80 is disabled by default so that other apps can use port 80; enable it on the configuration tab only if needed |
Setup using the shortest Duck DNS path
-
Confirm that you are not behind CGNAT
Do this first, or every later step may be wasted. Sign in to your router and find the public IP on its WAN status page. Then search for “my IP” on a phone or computer and note the address visible to the internet.
If they match, proceed. If they differ, you are likely behind CGNAT and this option will not work. Choose one of the preceding three options instead.
You can also identify CGNAT when the router's WAN address falls between
100.64.x.xand100.127.x.x, a range reserved for carrier-grade NAT. -
Register with Duck DNS
Sign in to the Duck DNS website with a supported account, create a subdomain, and copy the token shown at the top of the page.
-
Install and configure the Duck DNS app
Install Duck DNS from the official app store. On its configuration tab, enter the
tokenanddomainsvalue for your domain. Under Let's Encrypt, setaccept_termstotrue; the service will not run until you accept its terms.The default certificate filenames are
fullchain.pemandprivkey.pem. Do not change them without a specific reason.This app obtains certificates through DNS-01 validation. Let's Encrypt checks your domain's DNS record rather than connecting to your home. You do not need to open an inbound router port merely to obtain the certificate. The documentation also notes that if you point your own domain at a Duck DNS domain, you must add the required CNAME for the validation name or DNS-01 validation will fail.
-
Install the NGINX SSL proxy
Install the official NGINX Home Assistant SSL proxy. On its configuration tab, enter the
domainfor your Duck DNS address plus thecertfileandkeyfilenames above. The files are stored in the/ssldirectory. -
Configure trusted proxies
If you skip this step, the next one will fail. Follow the next section.
-
Forward port 443 on the router
This is the one step that opens an inbound path: forward only port 443 (HTTPS) to the Home Assistant host's reserved IP.
Do not open any port other than 443. In particular, never forward port 8123; doing so exposes the unencrypted sign-in page directly to the internet. Port 80 is unnecessary: the NGINX app disables port 80 by default, and DNS validation does not rely on port 80.
-
Set the external URL and test
Go to Settings → System → Network and enter
https://yourdomain.duckdns.orgas the External URL. Turn off Wi-Fi on your phone and test over mobile data.
The two reverse-proxy settings required for sign-in
This is the chapter's most common source of support requests. It applies whenever you use Cloudflare Tunnel, NGINX, Tailscale Serve or Funnel, or any other reverse proxy.
Why it breaks: Home Assistant sees the proxy, not you
Normally, Home Assistant checks the source IP of each request to record sign-ins, distinguish local traffic, and enforce IP bans.
With a reverse proxy in the middle, every request appears to Home Assistant to come from the proxy itself. You in one city, a relative in another, and a hostile internet scanner all look identical.
The proxy solves this by attaching an X-Forwarded-For header that identifies the request's real source. Home Assistant does not trust this header by default, because anyone can forge one. If it trusted arbitrary headers, an attacker could claim to be 127.0.0.1 and impersonate a local client.
You must therefore tell Home Assistant two things explicitly: (1) trust X-Forwarded-For, and (2) accept that header only from these specific proxy addresses.
400 Bad Request through the proxy usually means trusted_proxies is missing. Common symptoms are a page that opens but rejects valid credentials, or a full-page 400 error.2026.8 and later: configure it in the UI (recommended)
-
Open the network settings
Go to Settings → System → Network and find the HTTP server section.
-
Enable “Trust X-Forwarded-For”
Turn on the field named Trust X-Forwarded-For.
-
Enter the trusted proxy addresses
In Trusted proxies, enter the IP addresses or CIDR subnets of reverse proxies allowed to set
X-Forwarded-For. Use the table below to determine the value. -
Save and restart
Save the setting, restart Home Assistant, and test again.
Which address to enter
| Proxy | Trusted proxies value | Reason |
|---|---|---|
| A Home Assistant app (add-on), such as NGINX SSL proxy or Cloudflared | 172.30.33.0/24 | The official NGINX app documentation specifies this internal app-container subnet |
| Tailscale Serve / Funnel | 127.0.0.1 | The value specified in the Tailscale app documentation |
| A proxy running on the same host | 127.0.0.1 | The local loopback address |
| Another device on the LAN, such as a dedicated NAS or router | That device's reserved IP, for example 192.168.1.20 | Trust only its exact address |
Before 2026.8: configure it in configuration.yaml
Older versions do not provide these UI fields, so use configuration.yaml. For an app-based proxy, add:
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.30.33.0/24
For Tailscale Serve or Funnel:
http:
use_x_forwarded_for: true
trusted_proxies:
- 127.0.0.1
List multiple proxies on separate lines:
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.30.33.0/24
- 127.0.0.1
- 192.168.1.20
http: YAML block is deprecated. Warnings began in 2026.7.5, before 2026.8. They explain that HTTP settings in configuration.yaml have been imported, that http must now be managed under Settings → System → Network, and that the http: block should be removed before restarting. They also state: “This will stop working in version 2027.2.0; address the issue before upgrading.” After confirming that the settings were automatically imported into the UI, open configuration.yaml, delete the entire http: block, and restart. If the imported values do not appear, force-refresh the browser first.0.0.0.0/0 for convenience. It means “trust every address,” allowing anyone to forge a source IP, bypass IP bans, and falsify your sign-in records. Trust only the address or subnet that you know belongs to your proxy.Non-negotiable security rules
Home Assistant's security checklist identifies three core principles: use a strong, unique password for every account and enable multi-factor authentication; keep sensitive values in secrets and remember to back them up; and install the monthly updates. The actions below put those principles into practice.
secrets.yaml does not encrypt it. This centralizes sensitive values and prevents accidental disclosure when sharing configuration, but it is not a vault. Treat backups as confidential and never place them in a public cloud-storage folder. See Chapter 9 for backup practices.Rule 1: Never forward port 8123 directly to the public internet
(1) The default
http:// connection is unencrypted. Your username and password travel as plain text visible to intermediary systems.(2) Automated scanners continuously probe port 8123 worldwide. They can find an exposed system within minutes and begin repeated sign-in attempts.
(3) Compromising Home Assistant can expose your locks, cameras, and occupancy history.
If you have already created such a rule, delete it from the router now, then implement one of the four options above. This is the chapter's single most important instruction.
Rule 2: Enable MFA
Multi-factor authentication (MFA, also called two-step verification) requires both a password and the six-digit code that changes every 30 seconds in an authenticator app. A stolen password alone is then insufficient.
-
Open the Security tab in your profile
Select your name in the lower-left corner to open User profile, then select Security.
-
Enable a multi-factor authentication module
Find “Multi-factor authentication modules” and select Enable.
-
Scan the QR code with an authenticator app
Install an authenticator app on your phone, scan the QR code, then enter the six-digit code shown in the app to confirm.
-
Store the recovery information safely
Keep the recovery information somewhere other than your phone. If the phone is lost and no recovery method is available, you can lock yourself out.
-
Repeat this for every household account
Your own MFA cannot protect a relative's account with a password such as
123456. Chapter 5 covers multi-user management.
Rule 3: Enable IP banning
Home Assistant can ban an IP after a configured number of consecutive failed sign-in attempts. This is an effective defense against brute-force attacks.
Under Settings → System → Network, configure these two fields:
| Official field | Purpose | Suggested value |
|---|---|---|
| Enable IP banning (automatic IP bans) | Turns on automatic bans | Enabled |
| Login attempts before ban (failed-attempt limit) | “Number of failed login attempts allowed before an IP address is banned. Setting to -1 disables automatic banning.” | About 5. A lower value may ban you after a few typing mistakes |
Each banned address is written to ip_bans.yaml with the UTC time when it was added. To remove a ban, delete the corresponding entry and restart Home Assistant.
(1) With Home Assistant Cloud, all cloud connections appear as
127.0.0.1, so IP banning cannot distinguish them. Rely on MFA.(2) If trusted proxies are misconfigured, all requests appear to come from the proxy. Banning that address bans everyone—including you. Configure
trusted_proxies correctly first.Rule 4: Expose only essential services
Audit every inbound rule on your router. Many were created years ago for a camera, a download service, or a game and then forgotten.
| Possible exposure | Action |
|---|---|
| Port 8123 forwarded to Home Assistant | Delete immediately |
| UPnP, which lets devices open ports | Disable it. Any LAN device can otherwise create a firewall opening without your knowledge |
| Remote router administration | Disable it. The administration page should not be reachable externally |
| Camera or NVR ports | Close them and view the devices through Home Assistant or a VPN |
| NAS service ports | Keep only those you genuinely use and close the rest |
| Port 443 for a reverse proxy | Keep it; this is the only port that route requires |
Temporary external testing demands discipline
You may occasionally need ten minutes of external visibility to test a webhook, show someone a page, or debug an OAuth callback. Understand the risks and safeguards:
| Method | Risk | Required safeguard |
|---|---|---|
| Temporarily create a port forward | Highest. Continuous scanners may find it even within ten minutes | Enable MFA and IP banning first; set an alarm; remove the rule the same day |
| Temporarily use Cloudflare Tunnel | Low. No port is opened, and stopping the app removes the tunnel | Stop the tunnel after testing |
| Temporarily use Tailscale Funnel | Low to moderate. The URL is difficult to guess but publicly reachable | Disable it afterward and configure the trusted proxy |
| Start a Nabu Casa trial | Lowest | Decide whether to renew before the trial ends |
Professional deployments: VLANs, guest networks, and multiple NAT layers
The preceding guidance assumes one household and one router. Offices, shops, and more sophisticated residential installations introduce three additional concerns.
Isolate IoT devices on a separate network
Inexpensive smart plugs, bulbs, and cameras vary widely in firmware quality, and some never receive another update. A compromised smart plug on the same subnet as your laptop or NAS becomes a ready-made foothold.
A VLAN (virtual local area network) creates several isolated logical networks over the same physical infrastructure. A common design is:
| Network | Devices | Permitted access |
|---|---|---|
| Primary network | Computers, phones, NAS, Home Assistant host | Can connect to every network |
| IoT network | Plugs, bulbs, sensors, televisions | Can reach the internet but cannot initiate connections to the primary network |
| Camera network | IP cameras, NVR | Strictest rules; often no internet access at all, with only Home Assistant allowed to retrieve video |
| Guest network | Visitors' phones | Can access the internet but nothing in your home |
Multiple NAT layers: two routers at home
A common setup uses an internet provider's modem that also acts as a router, followed by a second router added for better Wi-Fi. This creates two NAT layers, placing Home Assistant behind two boundaries.
To identify this setup, sign in to your own router and inspect its WAN IP. If it shows a private address such as 192.168.x.x or 10.x.x.x, another NAT layer sits upstream.
| Solution | Method | Assessment |
|---|---|---|
| Put the provider's device in bridge mode | Ask the provider to change it, or use the modem's administration page | Cleanest. This leaves only one NAT layer |
| Forward the port through both layers | The outer router forwards to the inner router, which forwards to the host | Functional but fragile; resetting either layer requires reconfiguration |
| Use an option that needs no port forwarding | Nabu Casa, Cloudflare Tunnel, or Tailscale | Simplest. Multiple NAT layers do not affect them |
This is why the chapter emphasizes those three options: they bypass CGNAT, multiple NAT layers, and changing public IP addresses at once.
Pre-handover checklist
- The host IP is reserved on the router and recorded in the handover documentation
- The router's administration password has been changed from the factory default
- Both Internal URL and External URL are configured and tested
- MFA is enabled on every account and IP banning is active
- No router rule points to port 8123
- UPnP and remote router administration are disabled
- Backups are scheduled and stored away from the host (see Chapter 9)
- If VLANs are used, mDNS forwarding is configured and device discovery has been tested
- Automatic certificate expiration and renewal behavior has been verified
Troubleshooting
-
Let's Encrypt repeatedly fails to issue a certificate
First establish one fact: the Duck DNS app uses DNS-01 validation. Let's Encrypt checks your domain's DNS records and does not connect to your home. Certificate failure is therefore usually unrelated to ports; do not start opening router ports.
Check in this order. (1) DNS configuration: confirm that the Duck DNS domain exists, the token is correct, and the validation CNAME is present if you use your own domain. (2) DNS propagation: a new record takes time to become visible worldwide. Trying too soon fails. (3) Terms: forgetting to set
accept_termstotruein the Duck DNS app is extremely common. (4) Rate limits: Let's Encrypt limits repeated requests for one domain. Repeated retries can block further attempts temporarily; stop and wait rather than making it worse. (5) App logs: read the complete log, which contains the actual cause, rather than relying on the red status message alone. -
It works at home but not away—or the reverse
This almost always indicates incorrect local and external URLs. Under Settings → System → Network, confirm that both Internal URL and External URL are present and correct. Then open the Companion App settings and verify both values there as well.
For each field, stop after the port and do not append a path. A value ending in
.../lovelacecan corrupt generated notification and camera links, producing varied and misleading symptoms.If access works away from home but fails when you return, the IP in the Internal URL has probably changed. Return to the first section and reserve it.
-
The page opens, but sign-in fails or returns 400
This is the classic symptom of an untrusted reverse proxy. Return to the Trusted proxies section, enable Trust X-Forwarded-For, and enter the correct Trusted proxies value:
172.30.33.0/24for an app-based proxy, or127.0.0.1for Tailscale Serve or Funnel. Save and restart.If the values are already present, check whether they remain only in the old
configuration.yamlafter an upgrade to 2026.8. The UI values now take precedence, and the YAML block should be removed after verifying migration. If the values do not appear in the UI, force-refresh the browser. -
DDNS is configured, but external access still fails: CGNAT
Compare the WAN IP shown by your router with the result of an online “my IP” search. If they differ, you are probably behind CGNAT, through which an internet provider lets many customers share one public address.
Behind CGNAT, DDNS and port forwarding cannot provide inbound access; you do not have a unique public address. Your choices are: (1) ask the provider whether it offers a public IP, possibly for an additional charge or plan change; (2) use Nabu Casa, Cloudflare Tunnel, or Tailscale, none of which is affected; or (3) forgo remote access. Option (2) is practical for most households.
-
homeassistant.local suddenly stops working
First confirm that you are at home and that your phone is not on guest Wi-Fi or another subnet. Then connect directly by IP to verify that the host is running. If IP access works, only mDNS has failed. The most reliable long-term solution is to reserve the IP and bookmark that address.
-
You cannot connect after changing the port
If you changed it in the 2026.8 or later UI, do not panic or make further changes. Home Assistant waits for confirmation after changing the port. If you do not confirm within five minutes, it restores the old value and restarts. Wait for the automatic rollback.
On an older release, or after a manual change to a Container installation, restore the value from the host itself by attaching a monitor and keyboard or correcting the Docker port mapping.
-
Your own IP has been banned
Too many incorrect passwords triggered the ban. From the host, edit
ip_bans.yaml, delete your entry, and restart Home Assistant. If you cannot access the file, connect through another network—for example, a mobile hotspot—so your source IP changes. -
New devices disappear after you create VLANs
This is expected. Automatic discovery depends on multicast traffic that does not cross subnets. Enable mDNS forwarding on the router or firewall—mDNS Repeater, Avahi Reflector, or Bonjour Gateway—and add a rule allowing Home Assistant to initiate connections to the IoT network.
Frequently asked questions
I only want to check a light while I am away. Does remote access really need to be this complicated?
Online guides say to forward port 8123. Why does this chapter forbid it?
http://, so credentials travel in plain text); continuous scanning (automated systems probe port 8123 worldwide and may find it within minutes); and severe consequences (Home Assistant may control locks and cameras and contain occupancy history). All four options in this chapter provide the same remote access far more safely. There is no reason to expose it directly.I upgraded Home Assistant from a version before 2026.8. Does the URL still need :8123?
:8123. If you want a URL without the port number, versions from 2026.8 onward let you change it under Settings → System → Network, with automatic rollback after five minutes if you cannot confirm connectivity. Remember to update every bookmark, app setting, and reverse-proxy configuration afterward.My configuration.yaml contains an http: block. Should I remove it?
http: block should be removed. It also states: “This will stop working in version 2027.2.0; address the issue before upgrading.” First open Settings → System → Network and carefully confirm that every setting—especially trusted_proxies—was imported correctly. Then open configuration.yaml, delete the entire http: block, and restart. If the settings do not appear in the UI, force-refresh the browser first.Can Nabu Casa and Tailscale run at the same time?
127.0.0.1 to Trusted proxies.Why can a VPN not support Alexa or Google Assistant?
Can I simplify Trusted proxies by entering 0.0.0.0/0? Nobody is targeting my home.
0.0.0.0/0 means “trust any claimed source IP.” An attacker can forge an X-Forwarded-For header, impersonate any IP, defeat IP banning, and falsify your sign-in records. Automated scanners do not select individual targets; they scan the entire internet. Trust only the known proxy address: 172.30.33.0/24 for an app-based proxy, or 127.0.0.1 for Tailscale Serve or Funnel.How can I determine whether I am behind CGNAT in thirty seconds?
100.64.x.x and 100.127.x.x also confirms an address from the CGNAT range. Use Nabu Casa, Cloudflare Tunnel, or Tailscale instead; all three work behind CGNAT.Why do all attack records show 127.0.0.1 after I enable IP banning?
127.0.0.1. IP banning cannot distinguish those connections, so rely on MFA. Second: your reverse proxy is not trusted correctly, so every request appears to originate from the proxy. Do not ban that address; doing so would block everyone, including you. Correct the trusted_proxies configuration first.