Follow the next steps to create a cloudflare managed tunnel with the Cloudflare Zero Trust Dashboard and connect the Cloudflared Home Assistant add-on to use this tunnel.
- Open https://dash.teams.cloudflare.com and login.
- Search for the
Tunnels
section in theAccess
menu and create a new tunnel. - Name the tunnel (choose whatever you like) and hit save.
- The tunnel will be created and a code snippet will be displayed. Extract the token out of the code and copy it somewhere safe. (Depending on your OS the picture will vary)
- Add your first
Public Hostname
to proxy through the tunnel. - The pictures below shows how to configure Home Assistant with default HA config. (HTTP = SSL disabled, default port 8123)
- The corresponding DNS entry will be automatically added to your Cloudflare DNS Zone. If the entry is already exists, you will see a corresponding error message.
- The dashboard will show your newly created tunnel.
- You can
Configure
more hosts (e.g. your NAS, Code Studio add-on, ...) or continue with the next step. - Open your Home Assistant instance and open the Cloudflared add-on configuration
page. Search for the
tunnel_token
field, named Cloudflare Tunnel Token. - Copy in your token from step 4 of this guide.
- All other configuration options will be ignored.
- Start the add-on and check the logs.
- If everything went well, you should be connected to your tunnel.
- Check the Cloudflare Zero Trust Dashboard again to see that your tunnel is connected.
- You may add additional hosts from there. (Changes will be replicated to your tunnel without the need to restart the tunnel/add-on)
- Make sure to adapt your Home Assistant configuration.yaml to allow proxying traffic from this add-on.