Inside the system, running on virtual machine, I can access the running server at

Although the 'remote' address of the vm is (ping and ssh work fine), I cannot access the server with neither from the virtual machine nor from the local one.

I guess there's something preventing remote connections.

Here's /etc/network/interfaces:

auto eth1
iface eth1 inet static

ufw is inactive.

How do I fix this problem?

3 Answers 3


First of all - make sure that your HTTP server is listening on or everywhere ( by checking the output of:

netstat -tupln | grep ':5000'

If it isn't, consult Flask's documentation to bind to an address other than localhost.

If it is, allow the traffic using iptables:

iptables -I INPUT -p tcp --dport 5000 -j ACCEPT

From Flask's documentation:

Externally Visible Server If you run the server you will notice that the server is only accessible from your own computer, not from any other in the network. This is the default because in debugging mode a user of the application can execute arbitrary Python code on your computer.

If you have debug disabled or trust the users on your network, you can make the server publicly available simply by changing the call of the run() method to look like this:

  • 1) the output is* LISTEN. This means the server doesnot listen to addresses other tha localhosts? 2) I tried ufw allow 5000, no result Dec 1, 2012 at 22:14
  • This is why I suggested looking at the Flask's docs to configure it to listen on all addresses. Have you looked at it? Allowing it through the firewall alone won't fix it. Dec 1, 2012 at 22:25
  • Yes, thank you, I get it, already looking. Already used localtunnel(I know it's too much, but it works). Just trying to understand what netstat's output "* LISTEN" means. Dec 1, 2012 at 22:30
  • 2
    Created an account here just to favorite the question and upvote this answer!
    – Hephaestus
    Jun 15, 2015 at 15:54
  • 2
    For those of you who want to go right to the spot on the documentation rather than browse through a lot of it: flask.pocoo.org/docs/0.11/quickstart/#public-server
    – Dark Star1
    Oct 21, 2016 at 11:09

The best way to do it

flask run --host=
  • And how does one access it through the browser? is it your 192.168.x.x?
    – 3kstc
    Jan 27 at 0:01
  • you can access it via localhost on same device or local ip address like you mentioned 192.168.x.x Jan 27 at 14:38

I've just had the same issue. To solve it, i updated the way to run the application :


Using host= let me access my app through my local network.

To access your flask app all you need to do is in your browser type in:

[your devices ip address]:5000



You must log in to answer this question.

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