Skip to content

How to use share InstantWP over the web using ngrok

Seamus Brady edited this page Nov 27, 2017 · 6 revisions

Overview

InstantWP is not designed for live web servers, BUT in some situations you might wish to share your local InstantWP installation across the web temporarily - for instance to show a client a new design.

Caveats

  • You do need to be comfortable on the command line.
  • You need to make some changes to InstantWP to do this and THINGS CAN BREAK!
  • Do not attempt this with the only copy of your client's website. Take advantage of the portability of InstantWP and take a copy and use that.
  • This process opens up your machine to the internet and has some risks. Please be sure you understand what you are doing with tools like ngrok. If you are unsure, you can always just give a client a copy of InstantWP on a USB key :)

Steps

  • Take a copy of your InstantWP installation and make sure that your original is safe.

  • Download and install ngrok as per the instructions: https://ngrok.com/download

  • Start InstantWP.

  • Open a command line and run the ngrok command as below:

    ngrok http 10080

  • ngrok will start and give you a subdomain to use for sharing. For instance you may get something like

    https://c81c666b.ngrok.io

  • Copy this subdomain into the clipboard.

  • Use the InstantWP Control Panel to open the Web Console and login using iwp/iwp.

  • You need to update the WordPress URLs in the database to use the ngrok subdomain. Run the following WP-CLI command to do this placing your ngrok subdomain in the command:

    wp search-replace 127.0.0.1:10080 your-ngrok-subdomain.io

  • In our example, the command will look like this:

    wp search-replace 127.0.0.1:10080 c81c666b.ngrok.io

  • Now your InstantWP installation will be available over the web using the URL:

    https://your-ngrok-subdomain.io/wordpress

  • In our example, the URL will look like this:

    https:/c81c666b.ngrok.io/wordpress

  • You can stop sharing by stopping ngrok running.

  • To change InstantWP back to the original URL, run the WP-CLI command in reverse:

    wp search-replace your-ngrok-subdomain.io 127.0.0.1:10080

  • Of course, you can always just go back to the original copy that you took earlier :)

Clone this wiki locally