Ngrok is a powerful tool for exposing local servers to the internet. However, many developers assume the free tier only supports one tunnel at a time. The good news? With a little configuration, you can actually run multiple tunnels simultaneously β even on the free plan!
In this post, Iβll show you exactly how to do it.
Before we begin, make sure you have:
Ngrok installed (ngrok version
should work in your terminal)
Some services running locally (e.g. Laravel on port 5006, phpMyAdmin on port 8081)
After signing up, get your auth token from the Ngrok dashboard.
Run:
ngrok config add-authtoken YOUR_AUTHTOKEN_HERE
Or, set it directly in your config file as shown below.
Create a file named ngrok.yml
(you can place it anywhere). Hereβs an example with two tunnels:
version: 2
authtoken: YOUR_AUTHTOKEN_HERE
log: ngrok.log
tunnels:
laravel:
addr: 5006
proto: http
phpmyadmin:
addr: 8081
proto: http
Replace
YOUR_AUTHTOKEN_HERE
with your actual Ngrok auth token.
Now, run the following command in your terminal:
ngrok start --all --config=ngrok.yml
Ngrok will now launch both tunnels simultaneously β one for http://localhost:5006
and one for http://localhost:8081
. You'll see two public URLs generated, one for each service.
Open the generated Ngrok URL for your Laravel app β it should load correctly.
Do the same for phpMyAdmin β it should also be accessible.
While this setup works, be aware:
Each tunnel still has a random URL (unless you're on a paid plan).
Connection limits and data transfer caps apply on the free tier.
Tunnels will stop when you close the terminal or restart your machine.
Using a custom ngrok.yml
, you can easily run multiple tunnels β even on Ngrokβs free plan. This is especially useful when developing microservices, admin tools, or multiple frontends locally.
Now your local apps are internet-accessible, secure, and easier to test remotely!