I am running Node.js in a localhost on my Raspberry Pi 4. I would like to access the localhost in the browser of my phone. I have set up a stand alone access point on my Raspberry Pi and connected my phone to it. However, apparently I cannot access the localhost on my phone.

I also tried with

What do I need in order to get access to the localhost from my phone?

enter image description here

  • localhost means the same machine, it never refers to a different machine. – Michael Hampton Oct 9 '20 at 20:42
  1. Find your Raspberry pi ip address for the access point.
  2. Pass it in instead of localhost.

I would like to access the localhost in the browser of my phone

No, you don't. Although it is theoretically possible, it is most certainly not what you want.

What you want is to access your node.js application from your phone.

A network drawing will make this more clear.

          +-----------+                   +----------+
 localhost|           |    WiFi network   |          | localhost
      +===+   PI      +-------------------+ phone    +====+
          |           |                   |          |
          +-----------+                   +----------+

In general, your localhost is local for your host only. It resolves to, and the network on your phone is completely separated from the network on your Pi.

What you want is to access the Pi over the WiFi network. For that, use the WiFi-IP of your Pi instead of your localhost.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.