flask – Cant access server on Google Cloud Compute Engine

I’ve set up a Flask server on a Linux VM on Google Cloud Compute Engine.But I’m unable to access it through the external IP. I’m able to successfully test the server through its local host.

sudo wget http://localhost:5000/

I’m able to see the server receiving the requests successfully.

I start the server with the code

if __name__ == '__main__':
driver = initiate_webdriver()
app.run(host="", port=5000)

And after running

flask run

I get the output,

     * Serving Flask app 'app'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (
 * Running on
 * Running on

I understand I’m to setup firewall rules to allow the VM accept http/https requests. I believe I have done both things and yet can not access the server externallyfirewall rules

Read more here: Source link