Ngrok is a simple and powerful tool that allows you to create an instant, secure URL to your localhost server through any NAT or firewall. We’ll show you how to get it running on Ubuntu Core in the post.

So what does Ngrok do exactly and why would you want to use it? First, when you run the ngrok command it sets up a publicly access URL that will look something like this: ‘http://94601f4a.ngrok.io'. Then, it starts routing all traffic to that url to a local port of your choosing. So why is this useful? Imagine you are developing a local webserver that is only available on your local LAN and you want to show it off for a friend or colleague. Or imagine you developing a website for client and you would like to let them review your local copy. Ngrok is perfect for these use cases. You start you local server. Launch Ngrok, and then share your public URL.

Step 1: Install the Ngrok Snap

Installing Ngrok couldn’t be easier:

snap install ngrok

Also the Ngrok snap is now available on all major architectures, so you can even install it on your raspberry pi. :D

Step 2: Running Ngrok

Next you’ll want to point ngrok at your local server. In most cases you’ll use something like ngrok http 80, where 80 is the port of your local service.

Note, you don’t have to point it at just a port number. You can also point it at an IP address and port. This might be useful if you’re running a service somewhere on your local LAN and you want to run Ngrok from your laptop.

ngrok http 192.169.1.12:8080