Hi @igoramadas , I stumbled upon this tread, after having the x time of unavailability of DuckDNS DNS servers.
Would like to try Cloudflare, and noticed that you planned to make a tutorial for this.
Hopefully did you manage to do so?
Kind regards Bert
I used your guide and everything works fine. Thank you!
However, I needed a VPN so I set up WireGuard for Home Assistant and it wonât work with my domain name if Cloudflare is set to proxy it.
I am unsure what to do. I donât think I want to disable the Cloudflare proxy because itâs an added protection, right? But I also need to be able to connect back home from both phones and TVâs and more.
According to this posting I found a short time ago on Cloudflare, supposedly, there seems to be a workaround using Cloudflare Tunnels and WARP client (Wireguard).
Iâm new here, still trying to determine what permanent setup Iâm going to go with, so, for now, Iâm just collecting links to put the puzzle together later on. If I get a final answer, one way or another, and no one responds back before me, Iâll try to post my results since I would like to do the same thing.
can someone please post a video step by step on how to get https?
i got it working with cloudfare from another video but im not getting https as seen here:
@MattHodge wouldnât it now be easier and more secure to use Cloudflare WARP client and cloudflared tunnel instead? That wouldnât expose HA to the internet at all - neither directly via your router (because it doesnât need any ports being forwarded on your router), nor via Cloudflare. Only authenticated WARP client would be able to route traffic from your phone to your HA instance. You do still need a domain name (to be publicly resolvable) and point it to your.private.HA.IP.at.home (e.g. my-ha.example.com -> 192.168.1.9).
Split tunnels > Include IPs and domains (instead of the default exclude):
Selector: IP Address
Value: your.private.HA.IP.at.home/32
Description: hass-private
Save profile
Run docker compose up -d using the docker-compose.yml
On phone, install > 1.1.1.1 WARP (Cloudflare), then in that app go Settings > Account > Log into my-team.cloudflareaccess.com
Enable VPN > install suggested VPN profile (on iOS, or whatever pops up in Android)
With that setup, only traffic to your.private.HA.IP.at.home would go via WARP, and the rest would go directly to where it did before WARP. Then youâll be able to access your HA in the HA app (or browser) using http://my-ha.example.com:8139.
To eliminate the possibility of accidentally connecting to a malicious service instead of your HA, youâd have to set up SSL on HA using your domain (see Set up encryption using Let's Encrypt - Home Assistant), then use https://my-ha.example.com instead (recommended). I have SSL set up to cast to Nest Hub anyway.
SSL/TLS â Edge Certificates â Always Use HTTPS - Redirect all requests with scheme âhttpâ to âhttpsâ. This applies to all http requests to the zone.
When it comes to securing Home Assistant, the safest option is using Tailscale or Cloudflare Warp since it keeps your instance off the open internet. The downside? Youâll need to run a VPN client, which can drain your deviceâs battery.
That said, with mTLS, you donât need to run a VPN client, making it a solid option for Android users. Unfortunately, iOS doesnât support mTLS natively, so itâs not as universal.
I decided to go with a middle ground: exposing Home Assistant to the internet but securing it with Cloudflare Access, using GitHub (or another login provider) for authentication. This way, I donât need a client app running on my devices, and Cloudflare Access acts as the front door to my setup. Another benefit, I can also open the URL on my work computer in case I need to check something quickly.
For webhook integrations, Tailscale or Warp wonât work unless the sending device is running the VPN client. Cloudflare, on the other hand, offers a more flexible solution, you can use service tokens to bypass the initial login step when needed.
Iâm going down a rabbit hole to get my hass install open to the web to see if I can get CoPilot working with code-server. A bit of a tangent but Iâm curious if all Iâm after is https if I can use Tailscale or I need to keep chugging along.