WAMP Localhost on a Mobile Device

WAMP is software that allows developers to create a local server on your local computer to build and test web applications. By default, it is not possible to access the localhost server using a mobile device. This is an issue as mobile responsive websites are essential as global mobile usage continues to grow. With a few small changes, it is possible to test the mobile application on your mobile using WAMP.

The first step is to open the Command Prompt app and type in the command “ipconfig”. In the results list, IPv4 Address shows your IP that can be used for WAMP. Then we need to edit the virtual hosts file in WAMP. The file can be found in the WAMP folder -> Bin -> Apache (most recent version) -> Conf -> Extra -> httpd-vhosts.conf. Edit this file by changing “Require local” to “Require all granted”.

Now, we need to edit firewall rules to unblock WAMP. Go to Control Panel -> Windows Defender Firewall -> Advanced Settings. Then to add a new rule:

  • Click the Inbound Rules tab and click the New Rule button.
  • Check the Port option and click Next.
  • Check the TCP option.
  • Check Specific Local Ports and enter “80” into the text box (the port used by WAMP) and click Next.
  • Check Allow the Connection and click Next.
  • Ensure all three options (Domain, Private and Public) are checked and click Next.
  • Add a Name such as “WAMP Inbound” and click Finish.

Then repeat the same steps again for Outbound Rules. Then double-click each rule and ensure Allow the Connection is selected. Then, restart WAMP and check the icon is green. Then enter the IP into your mobile device and the WAMP localhost will appear.

Note – This method works when the mobile device is using the same Wi-Fi network as the computer with WAMP installed i.e. in an office or home Wi-Fi.

Check out my website: