What you’ll need
- Docker Desktop and Docker Compose installed.
- ngrok installed on your machine.
- Basic familiarity with the command line.
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 called Start the container:Visit
home-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.Configure ngrok to expose Home Assistant
Add ngrok to your In your terminal, restart your Docker container with this Visit your ngrok dashboard to see the endpoint URL.If you visit the ngrok URL, you’ll get a 4xx response and see an error log line in your Docker Desktop logs for the Home Assistant container:That’s because the Home Assistant configuration still needs to be updated to allow trusted proxies.
compose.yaml under the services section:compose.yaml file: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 your For details on these settings, see the Home Assistant HTTP integration docs.Restart the Docker container so the updated Home Assistant configuration can take effect, then visit your ngrok endpoint URL to see your Home Assistant instance online.
config directory, open configuration.yaml and add this snippet to the bottom: