10

ngrok's awesome web interface is pointed to http://127.0.0.1:4040 by default. I have other applications listening on that port, however, and need to change it so that ngrok listens on, say, http://127.0.0.1:4045.

zelusp
  • 3,500
  • 3
  • 31
  • 65

2 Answers2

17

Create a config.yml wherever ngrok is looking for its default config on your platform. If the directory doesn't exist, make it (on windows this is done by entering .ngrok2. as the folder name).

OS X /Users/example/.ngrok2/ngrok.yml

Linux /home/example/.ngrok2/ngrok.yml

Windows C:\Users\example\.ngrok2\ngrok.yml

Then, in config.yml enter

web_addr: 4045

Since this file is in ngrok's default config directory running ngrok http 1337 from the command line, for example, will now run ngrok listening to your server at port 1337 and serving its web interface on http://127.0.0.1:4045

Community
  • 1
  • 1
zelusp
  • 3,500
  • 3
  • 31
  • 65
  • I can't seems to find the config.yml file. I used homebrew to install ngrok on my mac, and it put here: Symlinking Binary 'ngrok' to '/usr/local/bin/ngrok'. – hypermiler Aug 13 '16 at 21:47
4

If you're not sure where the config file is located, you can run:

$ ngrok config check

It will print the path that the config file is being read, so if you're using Snap version, you'll get something located under ~/snap/xyz/.config/ngrok/ngrok.yml.

Then you can add web_addr: 4045 there.