Permission error on port 80
See original GitHub issue@tiangolo any ideas on what could be causing this error:
papi_1 | File "main.py", line 8, in <module>
papi_1 | app.run(host='0.0.0.0', debug=True, port=80)
papi_1 | File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 841, in run
papi_1 | run_simple(host, port, self, **options)
papi_1 | File "/usr/local/lib/python3.6/site-packages/werkzeug/serving.py", line 795, in run_simple
papi_1 | s.bind(get_sockaddr(hostname, port, address_family))
papi_1 | PermissionError: [Errno 13] Permission denied
Flask should always be listening on the port 80, right?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to run a server on port 80 as a normal user on Linux?
Short answer: you can't. Ports below 1024 can be opened only by root. As per comment - well, you can, using CAP_NET_BIND_SERVICE, but...
Read more >Listening error on port 80 when nothing else is using it
Normally a web server starts with uid=0, starts listening to port (say) 80, and then switches to an unprivileged user (like www-data in...
Read more >can't bind to port: 80 Permission denied - Google Groups
can't bind to port: 80 Permission denied. The problem is that my user probably does not have privileges to use port 80. No...
Read more >Node.js EACCES error when listening on http 80 port ...
Node.js throws following error while running on http port 80 (default port):- Error: EACCES, Permission denied at Server.
Read more >Permission denied in ec2 port 80 - Deploying Streamlit
You need sudo permission/root account for use the port 80. moh555m555 October 29, 2019, 3:53am ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Read the Docker getting started guide: https://docs.docker.com/get-started/part2/#define-a-container-with-dockerfile
It should help clarify several things.
If you listen on port 80 inside the container doesn’t mean that it will be listening on port 80 outside. For it to listen outside you have to map the ports with something like
"5555:80", that would make your host listen on port5555and send the communication to the port80inside the container.Are you changing the name of the user by any chance?
For debugging purposes, try using a “non-privileged” port, like 8080, and see if that works. That would hint that there are issues with onwership of the file, root access, etc.