Skip to content

Instantly share code, notes, and snippets.

@wosephjeber
Last active May 4, 2025 11:47
Show Gist options
  • Save wosephjeber/aa174fb851dfe87e644e to your computer and use it in GitHub Desktop.
Save wosephjeber/aa174fb851dfe87e644e to your computer and use it in GitHub Desktop.
Installing ngrok on Mac

Installing ngrok on OSX

For Homebrew v2.6.x and below:

brew cask install ngrok

For Homebrew v2.7.x and above:

brew install --cask ngrok

Using ngrok

The easiest way to use ngrok to tunnel into your localhost is if your local project is running on a specific port (e.g. not using named vhosts). You just run ngrok http [port number].

You can quickly boot up a local webserver using ruby. cd into the project's root directory and run ruby -run -e httpd . -p [port number].


If you don't want to use Homebrew...

  1. Download ngrok
  2. Unzip it to your Applications directory
  3. Create a symlink (instructions below)

Creating a symlink to ngrok

Run the following two commands in Terminal to create the symlink.

# cd into your local bin directory
cd /usr/local/bin

# create symlink
ln -s /Applications/ngrok ngrok

This will allow you to run the ngrok command from any directory while in the terminal. Without the symlink, you would need to either cd into the Applications directory (or wherever you installed the executable) or reference ngrok with its full path every time (e.g. /Applications/ngrok 5000)

@russorat
Copy link

russorat commented Oct 8, 2024

thanks! sorry my output was cut off, but i was also using the arm64 version. I see another report of this as well: ngrok/homebrew-ngrok#35

I tried curling the exact endpoint with no issues. I checked the cert attached to bin.equinox.io and is seems to be valid, so i'm not sure what's happening here. I will keep looking.

  ~ ❯ curl -O https://bin.equinox.io/a/dW4eR4uyHNy/ngrok-v3-3.16.1-darwin-arm64.zip              ✘ INT  25s  3.0.0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 8493k  100 8493k    0     0   148k      0  0:00:57  0:00:57 --:--:--  184k
  ~ ❯                                                                                                   57s  3.0.0
  ~ ❯                                                                                                         3.0.0
  ~ ❯                                                                                                         3.0.0
  ~ ❯ curl --insecure -vvI https://bin.equinox.io/a/dW4eR4uyHNy/ngrok-v3-3.16.1-darwin-arm64.zip 2>&1 | awk 'BEGIN { cert=0 } /^\* SSL connection/ { cert=1 } /^\*/ { if (cert) print }'

* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256 / x25519 / RSASSA-PSS
* ALPN: server did not agree on a protocol. Uses default.
* Server certificate:
*  subject: CN=bin.equinox.io
*  start date: Sep  6 23:46:44 2024 GMT
*  expire date: Dec  5 23:46:43 2024 GMT
*  issuer: C=US; O=Let's Encrypt; CN=R10
*  SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
*   Certificate level 0: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
*   Certificate level 1: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
* using HTTP/1.x
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* Request completely sent off
* Connection #0 to host bin.equinox.io left intact

@russorat
Copy link

russorat commented Oct 8, 2024

what does something like this show for you?
openssl s_client -connect bin.equinox.io:443 </dev/null 2>/dev/null | openssl x509 -inform pem -text

@VitaliyR
Copy link

VitaliyR commented Oct 8, 2024

@russorat Could not find certificate from <stdin>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment