Why does Flask use port 5000 locally and 80 when deployed? Why does Flask use port 5000 locally and 80 when deployed? flask flask

Why does Flask use port 5000 locally and 80 when deployed?


Flask's (Werkzeug's) dev server defaults to port 5000 if no port is specified. This is because binding to ports below 1024 requires elevated permissions.

You are not (or if you are, you shouldn't be) using the dev server in production, you're using a real WSGI server and HTTP server, such as uWSGI and Nginx, or Amazon's WSGI handler. The web server, independent of Flask, binds to port 80.