Skip to content

Run local server to test websites locally

Yoana Rios edited this page Sep 9, 2025 · 5 revisions

This is an installation guide to help developers test locally websites using a local server. In the past, we had many cases where it was easier to test locally to reproduce the bug, debug and fix. We use [W3Schools][https://www.w3schools.com/], which allows you to create a space where you can host HTML snippets and preview, but you will need to create an account and we have experienced issues running the snippets and testing on their website. Another solution is to have the HTML code hosted locally in your laptop and run a local server.

Sometimes, use cases for security issues are provided as an HTML page, so we need some way to host it locally to be able to reproduce the issue (either on a simulator or a real device).

Run local server

  • First, create a folder and save all HTML snippets that want to be test. MDN Web Docs is a great resource to learn about the web and [W3Schools][https://www.w3schools.com/]

  • Navigate to the folder containing the HTML snippets using cd

  • Run the command python3 -m http.server in a terminal window where the HTML use case page is located. Leave this running by keeping this terminal page open.

    Screenshot 2025-09-09 at 10 55 34 AM

Real device

If you want to run it on a real device, your phone and Mac should be on the same Wi-Fi. You can find your Mac Wi-Fi IP address in Network > Wi-Fi. For example: 10.0.0.109 Navigate to http://10.0.0.109:8000 on your real device. Do not use https as it won’t work.

Simulator

If you’re running from a simulator on your Mac, navigate to http://127.0.0.1:8000/ instead, which is the local port. Result You’ll be able to navigate by clicking to the use case on your real device or simulator

Clone this wiki locally