Example ngrok usage

Exposing local services can sometimes be a headache for developers - especially when you need a quick way to test your project from the outside world. Thankfully, services like ngrok exist to fix that problem by allowing developers to expose any local port to the outside world. This means that forwarding game servers over tcp, or a nodejs application over port 80 becomes a simple task.

The only drawback is that ngrok isn’t self-hosted and in order to have more than 1 ngrok process you need to pay per user per month. This can be expensive for home-labbers or startups, so luckily it’s possible to self-host ngrok!

Note: This self-hosted version of ngrok is 3 years old. Loophole Labs will be releasing https://lynk.sh soon which will be an up-to-date self-hosted tunnel for arbitrary tcp or HTTP traffic.

How? — Server

First, you’ll need a publicly accessible server. I’ll be using Digital Ocean’s smallest droplet for this, but a virtual machine on AWS, Azure, or GCP will work just as well.