Okay, so I'm semi-new to networking and to back-end web development, and am learning Flask presently.

I just turned on a basic little HTTP server on my laptop ("Hello World!") and am running it on port 5000. If I go to in my browser, I see the message correctly.

And if (on another computer in the house) I go to, the private IP of the computer being used for the server, then I can see it from there, too.

But what if I want a friend to be able to access it from outside the local network, from far away? How do they find it?

I asked google what my IP (IPv4) was and tried using that, but as I expected it didn't work, since (as I understand it) that just resolves to the router itself, not necessarily the particular computer running the server. What am I doing wrong here?

2 Answers 2


If you are using your home Internet and behind your router, then you need to setup a simple port forwarding to your local PC. Open up your router configuration and specify that port 5000 should lead to your private address (

It's also advisable to switch over any private address from dynamic to static for machines that host services so that their address does not change and thus break the port forward. This can be done simply by specifying an address for the machine in its network config that is outside the routers dynamic address pool (can be changed) and then specifying the routers address as both gateway and DNS server.

Example pool space: -
Example router IP:
Example web server private static IP:

Then someone else must go to your public IP address (you can check it by service like http://www.whatismyip.com/ or similar).

Your public IP is usually dynamic. That means it may change from time to time. You can either buy a static IP (not all ISP can offer it) or use special DNS services for such purposes (for example, http://www.no-ip.org/ , http://dyn.com and similar).

  • OH IS THAT WHAT PORT FORWARDING IS? I've wondered that forever. Commented Jan 9, 2015 at 4:29
  • Yes, that's for that purpose specifically. Please also note that some ISP block certain ports (i.e. 25, 80), but if you use something like 5000, then you should be fine.
    – nochkin
    Commented Jan 9, 2015 at 4:31
  • Do real web servers use port forwarding or do they have a much more complex hardware setup custom configured for receiving incoming traffic? Commented Jan 9, 2015 at 4:33
  • They usually have public IP directly assigned so they don't need to forward anything. There are also load-balancers where they use something similar to port forwarding but more complex.
    – nochkin
    Commented Jan 9, 2015 at 4:34
  • Lastly, I don't NEED a static IP, right? Only if I really intend for this to stay up and be usable long-term. If I'm just playing around tonight, it doesn't matter, correct? And what about what this other guy is saying about a firewall rule? Sorry to have so many questions. Commented Jan 9, 2015 at 4:35

See http://www.howtogeek.com/117371/how-to-find-your-computers-private-public-ip-addresses/ for a good explanation of your public and private IP addresses. In addition, you'll need a firewall rule to enable a list of IP's or to enable all IP's to send incoming messages to your PC; you can restrict traffic to a port [e.g. 80 for HTTP] or an array of ports. You might wish to delete that firewall rule when your done.

In addition, your router might also need to be configured to enable incoming traffic.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .