2

I have some issue to configurate Ngrok.

I have installed the Ngrok on linux CentOS server dedicated (IP 192.168.1.124), it works correctly the tunneling is ok. My question is: how i can reach the web page on 127.0.0.1:4040 in order to check the traffic on my Ngrok server?

The web interface page is only accessible on the server where ngrok is running, but if this is a linux minimal server (without gui and any type of browser) I can't see it. is there a way to make it accessible also in LAN?

e.g. I have another client that can reach the IP where ngrok is running but if i put on web browser http:\192.168.1.124:4040 nothing is showing. I see from netstat that this port is not listening so isn't a firewall problem or other.

Is possible to change config of Ngrok? otherwise are there other possibilities ? do i have to use a reverse proxy or something like? Any ideas?

thanks for your help,

Luca

Luca
  • 21
  • 1

2 Answers2

1
  1. Locate your ngrok's config file:
$ ngrok config check
Valid configuration file at /home/youruser/.config/ngrok/ngrok.yml
  1. Add to the config file the following line:
web_addr: 192.168.1.124:4040

In case you want to expose it to all interfaces, you can replace that value with 0.0.0.0:4040

Bechma
  • 425
  • 6
  • 11
0

If you run Ngrok in docker, using the ngrok/ngrok image from dockerhub then this seems to work fine almost out of the box as long as you map port 4040 from your host to the running container and slightly modify the command used to create the tunnel.

For example, this docker-compose.yml file will start ngrok, tunneling to a http service on port 80, and expose the "inspect" page on port 4040:

version: '3.7'
services:
  ngrok:
    image: ngrok/ngrok
    ports:
      - "4040:4040"
    command: http 192.168.0.1:80
    environment:
      - NGROK_AUTHTOKEN="xyz"

Notes:

  1. When running in docker you need to specify the IP address of the host machine, assuming you are tunneling to a service running directly on the local host (or available via it's network interface).
  2. The example above creates a tunnel to port 80 on the local host (which has IP address 192.168.0.1). This is equivalent to ngrok http 80 if run outside of docker.
  3. Optionally you can set an environment variable to hold your AUTH token, as shown.
Charlie Joynt
  • 4,411
  • 1
  • 24
  • 46