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?
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.