What you’ll need
- Docker Desktop and Docker Compose installed.
- ngrok installed on your machine.
- Basic familiarity with the command line.
1. Run Home Assistant
This guide runs Home Assistant in Docker, but the same ngrok setup works with any installation method. If you’re starting from scratch, follow the Home Assistant installation docs and choose the Container method to run it with Docker Compose. Create a directory calledhome-assistant, then inside it create a config directory and a compose.yaml file similar to this:
localhost:8123 in your browser to confirm you see the Home Assistant login page.
2. Configure ngrok to expose Home Assistant
Add ngrok to yourcompose.yaml under the services section:
compose.yaml file:
3. Allow trusted proxies in Home Assistant
Because ngrok forwards requests to Home Assistant as a reverse proxy, Home Assistant blocks them until you list the proxy as trusted. In yourconfig directory, open configuration.yaml and add this snippet to the bottom: