Developing software in the Real World

Using ngrok to test on a mobile

To test a website that you’re developing on your local computer on a mobile device such as a phone or tablet use ngrok.

This is the way to do it:

  1. Start up ngrok: $ ngrok http my-dev-site.local:80
    This will start up ngrok and give you a “Forwarding” URL such as
    In this case, it will direct all traffic to that URL to http://my-dev-site.local. If you run
    your website on a different port, such as http://localhost:8888, then use $ ngrok http 8080
  2. If your website’s base url is configured in a config file, then update it to be the Forwarding URL.
  3. Go to the Forwarding URL (, in this example) on your mobile and test!

It’s not hard to do this, but this will save me having to look it up next time!

Also published on Medium.

Thoughts? Leave a reply
