Skip to main content
This guide walks you through setting up Home Assistant with ngrok. This combination lets you access your Home Assistant dashboard over the public internet.

What you’ll need

This guide walks through setting up Home Assistant in a Docker container from scratch. The same principles apply if you already have a Home Assistant instance set up, or if you set it up using one of their other installation methods.

1. Initial setup

Create a directory called home-assistant and inside it:
  • Create a Docker Compose file called compose.yaml
  • Create a directory called config

2. Run Home Assistant in a Docker container

Update compose.yaml:
In your terminal, start a Docker container with this compose.yaml file:
Visit localhost:8123 in your browser. You should see your Home Assistant login page.

3. Configure ngrok to expose Home Assistant

Add ngrok to your compose.yaml under the services section:
In your terminal, restart your Docker container with this compose.yaml file:
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.

4. Allow trusted proxies in Home Assistant

In your /home-assistant/config directory, look for the file called configuration.yaml. By default, it should already have these settings:
Add this snippet to the bottom:
Restart the Docker container so the updated Home Assistant configuration can take effect. Visit your ngrok endpoint URL to see your Home Assistant instance online.