AWS EC2 - Open Instance Port 

Here's a guide, if you want to open a specific port on AWS EC2 Instance :


1.  Login to your AWS Console 
    https://console.aws.amazon.com/console/home?region=us-east-1

2. Go to EC2 Console

3. Click Network & Security -> Security Groups 



We can see default security group, ignore that for now. 
Click launch-wizard-x security group name (this security group created automatically when we create ec2 instance)

4. Open Detail Security Group
 
We can see Inbound Rules ( manage incoming connection, from outside to our system ) and Outbound Rules (this will manage connection from our system to outside )



We can see on my EC2 Instance, i'm allowing outside network to connect ec2 instance using port 22 (ssh), port 80 (http), and port 443 (https, not displayed on screenshot).

5. Click Edit Inbound Rules -> Add Rule



We can see alot of predefined rules here, choose one, add Source (in CIDR). If you want to allow all IP (both IPV4 and IPV6) to connect into our server, just use 0.0.0.0, ::/0

Click Save Rules

6. Verify that the port  can opened from outside

If you're on Linux/Unix based OS, you can use nc

Check if port 22 opened
nc -zvw3 your-ec2-public-address 22

Check if port 80 opened
nc -zvw3 your-ec2-public-address 80

If the port opened, it will give us the following output

Connection to :your-ec2-public-address port :port [tcp/http] succeeded!

That's all!

Comments