AWS networking decides who can talk to your server. Linux firewall decides who is allowed inside the server. You must understand both.
VPC (Virtual Private Cloud) is your private network inside AWS. Every EC2 runs inside a VPC.
Security Groups work at AWS level. They control traffic BEFORE it reaches Linux.
SSH → Port 22
HTTP → Port 80
HTTPS → Port 443
Linux firewall protects the OS itself.
sudo ufw status
sudo ufw allow ssh
sudo ufw allow 80
sudo ufw enable
AWS Security Group + Linux Firewall = Real Security Never rely on only one.
Next: Installing Web Server & Apps →