DEV Community

Discussion on: From Code to the Cloud: A Step-by-Step Guide to Deploying Your Node.js App on AWS EC2

Collapse
 
some_dev profile image
some_dev

If you cannot access your application from the global IP or experience timeouts, the solution is provided here.

In its simplest explanation, the port on which your JavaScript app is listening does not match the AWS EC2 Cloud port.

Navigate to EC2 > Security Groups, select your launch wizard, and click on the security group ID. At the bottom of the page, you will find the 'inbound rules' section, including https, ssh, and http. Take note of the 'Port range' value for the protocol you use to access the server. Replace this port range value with the listening port in your JavaScript application and start your application. From now on, you can connect to the global IP address without specifying any custom port values.

NOTE: I solved the problem I encountered in this way. Below is a screenshot I obtained from another guide related to what I explained. I hope it helps.

miro.medium.com/v2/resize:fit:1400...

Collapse
 
sapinder_dev profile image
Sapinder Singh • Edited

Hi, I could not change the Port Range as it is disabled for me. I tried doing it with the root AWS account as well, but with no success. Could you help me figure it out?

Image description

Collapse
 
pythonuserux profile image
Andrea Virgillito

You have to choose CUSTOM TCP instead of SSH, otherwise the default port value can not be changed apparently