Skip to content
Derschatta edited this page Oct 5, 2021 · 15 revisions

Ngrok (pronounced en-grok) is a useful tool for making your local Totara site accessible publicly on the web. This is especially handy when testing intergrations with Totara, such as the mobile app, or external services such as Microsoft Teams, LinkedIn Learning, or even if you simply want to make your site available for someone else to look at.

You will first need to sign up for an account, and then install and authenticate ngrok on your machine. You will also need to make sure that the ngrok command can be run normally - this may require adding your ngrok installation directory to your $PATH variable.

The easiest way to set up ngrok for use with Totara is to simply use the example config.php that is provided with this repo in your sites.

You will then need to make sure your /etc/hosts file is up to date with your site definitions. You can update your /etc/hosts file automatically by running the tool/set_hosts.sh script.

Once ngrok is set up, you can use the tngrok command to use it with Totara.

Example command:

tngrok yoursite.totara74

You would see something like:

ngrok by @inconshreveable                                                                                                                                                                                        (Ctrl+C to quit)

Session Status                online
Account                       [email protected] (Plan: Free)
Version                       2.3.40
Region                        Australia (au)
Web Interface                 http://127.0.0.1:4040
Forwarding                    https://a123-b12-c34-56-78.au.ngrok.io -> https://yoursite.totara74:8443

Connections                   ttl     opn     rt1     rt5     p50     p90
                              0       0       0.00    0.00    0.00    0.00

Now you can access the site using the url shown in "Forwarding", in this example https://a123-b12-c34-56-78.au.ngrok.io. The url is accessible publicly so make sure you shutdown ngrok if you don't use it anymore (Ctrl-C).

Clone this wiki locally