LazyCodet

a

21:42:43 14/6/2025 - 1 views -
Programming

Run Multiple Ngrok Tunnels with a Free Account

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.


πŸ“¦ Prerequisites

Before we begin, make sure you have:

  • A free Ngrok account

  • Ngrok installed (ngrok version should work in your terminal)

  • Some services running locally (e.g. Laravel on port 5006, phpMyAdmin on port 8081)


πŸ›  Step-by-Step Guide

Authenticate Ngrok

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 ngrok.yml Configuration

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.


Start All Tunnels

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.


πŸ§ͺ Test It Out

  • Open the generated Ngrok URL for your Laravel app β€” it should load correctly.

  • Do the same for phpMyAdmin β€” it should also be accessible.


⚠️ Limitations of the Free Plan

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.


βœ… Conclusion

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!