How to easily test your local website or PWA on your phone

Date Published

Time Commitment

0 minutes

Ego Number

13 views

You might not know it, but you can host a website on your local network with just a single command! This trick works on macOS, but I'm not sure about other operating systems.

  1. Open Terminal and navigate to the directory of your app
  2. Type php -S 0.0.0.0:8000 (or whatever port you want)
  3. Find your private IP address in System Preferences > Network
  4. Make sure your phone and computer are on the same WiFi network
  5. Open <IP ADDRESS>:8000 on your phone