Ports are not available: listen tcp 0.0.0.0:3000: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

Jihoon Park
1 min readMay 26, 2020

--

Recently, I’ve been developing a React application using Docker on Windows. I expose the port 3000 for my frontend service in my docker-compose.yml. However, all of a sudden, I got the following error today:

ERROR: for frontend  Cannot start service frontend: Ports are not available: listen tcp 0.0.0.0:3000: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

I don’t exactly know why, but I’m suspecting that the new Windows update that installed version 2004 is the culprit. I just learned the command netsh interface ipv4 show excludedportrange protocol=tcp here. I got the following result when I ran the command:

As you can see, the port 3000 has been excluded for some reason. I could have opened the port, but I assumed it was excluded for a reason and changed my port to 3200 instead. Now it’s working, but I wonder why this happened in the first place, because so many people use React on the default port…

--

--