- Newest
- Most votes
- Most comments
Hi idesk-dev,
Please try this solution it will be helpful for you.
Security Group Configuration:
Verify that the security group associated with your EC2 instance allows inbound traffic on the specific port (3333). You should have a rule that allows inbound TCP traffic on port 3333 from your IP range or 0.0.0.0/0 if you want to allow all IPs for testing purposes. Similarly, make sure that the outbound rules of your security group allow traffic to leave the instance.
whenever you start and stop instance while you can see like public ip change check your public ip
https://docs.aws.amazon.com/vpc/latest/userguide/vpc-security-groups.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-security-groups.html
To troubleshoot connectivity to an application on a custom port (e.g., 3333) on an AWS EC2 instance:
Check Security Group: Ensure the security group allows inbound traffic on port 3333 from 0.0.0.0/0.
Verify Network ACLs: Ensure the subnet's NACL allows traffic on port 3333.
Firewall Settings: SSH into the instance and ensure the firewall (e.g., iptables, firewalld) isn't blocking port 3333.
Public Access: Ensure the instance has a public IP and test connectivity from an external machine using curl http://<PUBLIC_IP_ADDRESS>:3333.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules.html
Thanks for the insights. Actually the process running on the port 3333 was having startup errors. We fixed those application issues and restarted the elastic beanstalk environment. That fixed the connection refused error. Thanks.
Relevant content
- AWS OFFICIALUpdated 3 years ago

Yes, security group allows inbound traffic on port 3333 from all ip ranges. But still couldn't connect the instance. Should we do anything on Route tables under subnet?
yes, you can check once like subnets & Route tables allow traffic internet gateway. and please go through the AWS Document link you will get more information about.
https://docs.aws.amazon.com/vpc/latest/userguide/WorkWithRouteTables.html#:~:text=You%20can%20create%20a%20custom%20route%20table%20for,Name%2C%20enter%20a%20name%20for%20your%20route%20table.
https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html