Back to TILs


Date: 2022-12-12Last modified: 2023-02-17

ngrok is a globally distributed reverse proxy fronting your web services running in any cloud or private network, or your machine.


From copy the apt command:

curl -s \
  | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null \
  | && echo "deb buster main" \
  | sudo tee /etc/apt/sources.list.d/ngrok.list \
  | && sudo apt update \
  | && sudo apt install ngrok


Connecting your account according to

ngrok config add-authtoken 2Ip...BYo
Authtoken saved to configuration file: /home/geraldo/.config/ngrok/ngrok.yml

Basic usage

Serving a webpage

Starting a server on localhost:

http-server ./

Expected output:

Starting up http-server, serving ./

http-server version: 14.0.0

http-server settings: 
CORS: disabled
Cache: 3600 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none

Available on:
Hit CTRL-C to stop the server

Piping port 8080:

ngrok http 8080
Session Status  online
Account         Geraldo Ribeiro (Plan: Free)
Version         3.1.0
Region          South America (sa)
Latency         13ms
Web Interface
Forwarding -> http://localhost:8080