Docker Error: An attempt was made to access a socket in a way forbidden by its access permissions

asheroto
1 min readJun 7, 2021
Docker logo

This issue isn’t exclusive to Docker; it can happen in other contexts as well.

This error occurs when an application tries to bind to a port that is already in use or restricted. By stopping the NAT service and setting additional dynamic port ranges, you’re essentially freeing up ports available for use. After that, restarting the NAT service applies the changes.

To fix, open PowerShell as administrator, then run…

net stop winnat
netsh int ipv4 set dynamic tcp start=49152 num=16384
netsh int ipv6 set dynamic tcp start=49152 num=16384
net start winnat

Problem fixed!

Thanks to iamsurfing for this fix.

Consider becoming a Medium member if you appreciate reading stories like this and want to help me as a writer. It costs $5 per month and gives you unlimited access to Medium content. I’ll get a little commission if you sign up via my link.

--

--

asheroto

🌎 Full Stack Developer 🔗 Systems Administrator 😎Innovation through Automation ✔ Privacy Advocate ♥ Startup Facilitator