Running multiple ngrok tunnels for free
ngrok is a fantastic tool that allows exposing your local development environment to the internet. I wish I knew how to run multiple tunnels for free when I started using it.
ngrok config check- check where you config file is located.- If you haven’t already, I suggest you claim you a free ngrok subdomain. You can do it in the ngrok dashboard. While it is not required to run multiple tunnels, it is a nice to have. Otherwise you will get random URLs for each tunnel.
- Edit the config file and add the following lines:
tunnels:
first:
addr: 3000
proto: http
domain: your-subdomain.ngrok.io
second:
addr: 3001
proto: http
- Run
ngrok start --allto start all tunnels orngrok start first secondto start specific tunnels.
Calling ngrok start first second will:
- Tunnel the first app from port 3000 to
your-subdomain.ngrok.io. - Tunnel the second app from port 3001 to a random ngrok URL.
And that’s it 🎬.