Hydromast
Hydromast

Reputation: 312

Ports are not available when attempting to run Node Red in Docker

When I am trying to run the Docker container for Node Red using the following command:

docker run  -p 1880:1880 --name mynodered nodered/node-red

I get the following error:

c:\program files\docker\docker\resources\bin\docker.exe: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:1880: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

I have tried using netstat to find anything that's using up the port and I've found nothing. I've also tried to open up the ports in Windows Firewall and this still errors out.

Is there any other way to run Node Red on Windows Docker with port 1880?

Upvotes: 0

Views: 2153

Answers (3)

Proximo
Proximo

Reputation: 6531

You don't need to run node-red on that particular port if it's reserved.

Try something like this:

docker run -dit -p 8880:1880 --name mynodered nodered/node-red

Then navigate to:

http://localhost:8880

Upvotes: 0

Hydromast
Hydromast

Reputation: 312

After much searching, I've found an answer to this. The port is being reserved by Hyper-V, so you will need to remove it, add the port to exclusion list, then readd Hyper-V.

My solution is based on this answer: https://stackoverflow.com/a/59044246/3866585

Upvotes: 0

jmaitrehenry
jmaitrehenry

Reputation: 2400

It's a know issue on Windows with some workaround available.

You can block HNS to reserve high ports with this registry key:

reg add HKLM\SYSTEM\CurrentControlSet\Services\hns\State /v EnableExcludedPortRange /d 0 /f

And reboot.

For more details, you can check this github issue.

Upvotes: 1

Related Questions