Unable to start Kestrel. System.Net.Sockets.SocketException (13): Permission denied

7/5/2020
Back to List

Problem

When running a ASP.NET Core application as a non-root user, Kestrel fails to bind to port 80 and 443.

Unable to start Kestrel. System.Net.Sockets.SocketException (13): Permission denied

Solution

To allow the app to bind to privelaged ports between 1 and 1023 run the following command, adjusting the path to the binary.

sudo setcap CAP_NET_BIND_SERVICE=+eip /path/to/binary

SuperChad
Gravatar About Sean Nelson
I like codes and stuff.

4 comments
Gravatar p73564 - 1/1/2025 9:44:15 AM
Nice post. I learn something new and challenging on blogs I stumbleupon everyday. It will always be interesting to read through content from other authors and use a little something from their sites.
Gravatar DOES STEM CELL THERAPY - 1/4/2025 4:50:56 AM
what is THE costofstemcell.com that we are conducting? Example can serve embryonic stem cells (ESC). microRNA transfer by microvesicles of embryonic stem cells.
Gravatar Fafcryday - 11/14/2024 9:46:32 PM
Improvement of cyclosporine A bioavailability by incorporating ethyl docosahexaenoate in the microemulsion as an oil excipient <a href=https://fastpriligy.top/>priligy</a>
Gravatar cheap cytotec online - 11/28/2024 7:13:23 PM
For women under 35, diminished ovarian reserve can signal premature ovarian failure, which is when the ovaries stop functioning before age 40 see section below <a href=https://cytotec2buy.top/>generic of cytotec</a> Estimation of the dietary requirement for vitamin D in free living adults 64 y of age