Close full mode

Enable public URL during development

Git RepositoryEdit on Github

Make your local development can be accessed with a public URL

Install ngrok

  • Download ngrok
  • Then run:
  • Connect to your account.
./ngrok authtoken your-authentication-token
  • Get your-authentication-token from
  • This will add your authentication token to ~/.ngrok2/ngrok.yml, a default configuration file.

Configure ngrok region

  • Open ~/.ngrok2/ngrok.yml.
vi ~/.ngrok2/ngrok.yml
  • Add region key and a valid region [us, eu, au, ap, sa, jp, in] (default: us).
  • To use Asia Pacific region, use the following configuration.
authtoken: your-authentication-token
region: ap
  • Save a configuration and quit (:wq).

Start ngrok to serve a public URL

  • Use the following command to start ngrok and forward a public URL to localhost port 8000.
./ngrok http 8000
  • You will logging messages like this:
ngrok by @inconshreveable
Session Status online
Account your-email-address (Plan: Free)
Version 2.3.40
Region Asia Pacific (ap)
Web Interface
Forwarding -> http://localhost:8000
Forwarding -> http://localhost:8000
Connections ttl opn rt1 rt5 p50 p90
0 0 0.00 0.00 0.00 0.00
  • Press ctrl+c to exit the process.

Configure ngrok to serve multiple ports

  • Open ~/.ngrok2/ngrok.yml
vi ~/.ngrok2/ngrok.yml
  • Add the following contents:
authtoken: your-authentication-token
region: ap
addr: 3000
proto: http
addr: 3001
proto: http
  • Save a configuration (:wq) and start ngrok with a command:
./ngrok start --all


Loading comments...