Skip to main content
If you’re more comfortable using Docker Compose, you can use the following as a starting point. Copy the contents below into a new file named docker-compose.yaml, then run docker compose up in that directory. This Docker Compose file assumes you have an ngrok.yml file in the same directory with at least one endpoint defined. See the ngrok agent config file documentation for help creating a configuration file. To reuse the same configuration file as your local ngrok agent, find the default config file’s location with ngrok config check.
If you define your endpoints directly in docker-compose.yaml rather than using an ngrok.yml file, the configuration looks a little different. The command runs an ngrok http command, and on Mac or Windows you point it at the special URL host.docker.internal so the container can reach a service on your host (see Networking on Docker Desktop). The following example runs ngrok alongside the dockersamples/static-site image.