I try to open a port in my instance of AWS Lightsail to be able to raise an application in NodeJs. Enable the Firewall rules as seen in the image.

enter image description here

but when I run nmap -sT -O localhost I can see that the port is closed.

enter image description here

The port that I try to open is 4000. UFW is inactive. Would appreciate your help.

  • Two problems: By default, nmap only checks 1000 of the most commonly used ports. Does it even check 4000? Also, localhost traffic is not affected by the Lightsail firewall. All of localhost is always accessible, so nmap would not prove anything. – Michael - sqlbot Feb 19 at 20:42
  • The nodejs app might not be listening on the localhost interface. Check what address the nodejs app is binding to and check if the port is open there. Also like michael-sqlbot metioned: nmap might not even be looking at that port; use the -p option to nmap to list ports to scan. – mjb2kmn Feb 20 at 3:54

The firewall and port settings are listed in the Networking tab of your instance's management page in the Amazon Lightsail console. Choose Edit rules or Add another to change or create rules.

More info:

Amazon Lightsail Info

  • in effect I added the port I need there and still when I run nmap I get the port is closed and therefore I can not raise my application in that port. – Diego Bsc Feb 19 at 20:49
  • Check the docs, that port your trying to open (4000) might not be allowed? – Marcus Patman Feb 19 at 22:38

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.