What port / web server location is Local using?

Sorry about the link. It points to the Local Lightning Beta category, which is locked.

The gist of the discussion is that it turns out to be possible to serve Local 5.X pages to other computers, phones, and tablets on your local network.

The reason you might want to do this is so that you can view/test your sites on other devices to make sure that they look the way you want them to. Chrome can simulate different display sizes but it can’t simulate other devices. For instance, Safari on the iPhone does CSS things with input tags that Safari on Mac doesn’t do.

The solution for this that’s built into Local is ngrok.io. But, as you have observed, the connections are throttled and it turns into a waiting game.

A Local user, louisefindlay23, has figured out how to get the same functionality on a local network, using only Local 5.X. Here’s what you do:

  1. Go to Preferences > Advanced and switch the Router Mode to “localhost”.
  2. Go back to the main window and choose the site you want to view. Local will warn you that the WordPress URL settings for this site don’t match the host set in Local. Ignore this for now, we’ll deal with it in step 4.
  3. Look under “Site Host” in the main Local window to find the port for the site you want to access. It will look like a New York zip code “10001” or “10005” or some such.
  4. Change the Site Address URL (I also change the WordPress Address URL) to the IP address of the host computer, followed by the port number (e.g. "“http://192.168.1.2:10005”). This is necessary so that the browser can find your CSS and images. Observe that you have to use “http” for this because the localhost mode doesn’t support “https”. You might want to do this in Sequel Pro because your site is going to look like a mess until this change is made. Just go to the Database tab in Local, choose Sequel Pro and you’ll see your site database. Then go to the wp-options table, choose “Content” at the top of the window and the first two options are the ones you want to change.
  5. Navigate to your site using the IP address that you set above. The View Site button in Local will take you to “localhost:10005” which may or may not work depending on what browser you’re using.
  6. You may have to clear your browser caches to get this working. But if everything is working properly, you should be able to view your sites on other network devices.
2 Likes