ngrok

Official Guide

Table of contents
  1. Installation
  2. Setup
  3. Forward a local port to a public URL

Installation

brew install ngrok/ngrok/ngrok
# OR
brew install --cask ngrok

Check installation via:

ngrok -h

Setup

To use ngrok you must be signed up for an account.

You can do this via the official website.

Once you login, you will be given an authtoken to authenticate ngrok.

Copy the value and authenticate in terminal:

ngrok config add-authtoken $AUTH_TOKEN

Forward a local port to a public URL

Run the following command:

ngrok http $PORT

The public URL will be displayed in the terminal:

...
Forwarding                    https://some.url.given.ngrok.io -> http://localhost:$PORT
...

For free plans, the URL changes every time you restart ngrok.