Skip to content

Put local keycloak instance on the internet with ngrok

In this sample we want to make our keycloak instance running on localhost available via https via a ngrok https proxy setup

  • Local Keycloak URL: http://localhost:8280/auth/

Step 1: Get ngrok Token

Connect your agent to your ngrok account using following URL

Now that the ngrok agent is installed, let’s connect it to your ngrok Account. If you haven’t already, sign up (or log in) to the ngrok Dashboard and get your Authtoken. The ngrok agent uses the authtoken (sometimes called tunnel credential) to log into your account when you start a tunnel.

Copy the value and run this command to add the authtoken in your terminal.

# ngrok config add-authtoken 2DThrErQiVCq7...

Step 2: Start ngrok using our keycloak port 8280

Start ngrok by running the following command.

# ngrok http 8280
ngrok                                                                                                                                                                                          (Ctrl+C to quit)                                                                                                                                                                                                               Hello World!                                                                                                                                                                                                                                                                                                                                                                                Session Status                online                                                                                                                                                                           Account              (Plan: Free)                                                                                                                                            Version                       3.0.6                                                                                                                                                                            Region                        Europe (eu)                                                                                                                                                                      Latency                       20ms                                                                                                                                                                             Web Interface                                                                                                                                                                   Forwarding           -> http://localhost:8280                                                                                                                                                                                                                                                                                                         Connections                   ttl     opn     rt1     rt5     p50     p90                                                                                                                                                                    0       0       0.00    0.00    0.00    0.00  

Step 3: Open Browser and test global keycloak URL

Press View Site

Keycloak Page should be shown in your browser

Published inKeycloak

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *