AWS + Linux Combo — Part 5: Networking & Security Groups

AWS networking decides who can talk to your server. Linux firewall decides who is allowed inside the server. You must understand both.

What is a VPC?

VPC (Virtual Private Cloud) is your private network inside AWS. Every EC2 runs inside a VPC.

Security Groups (AWS Firewall)

Security Groups work at AWS level. They control traffic BEFORE it reaches Linux.

Common Security Group Rules


SSH    → Port 22
HTTP   → Port 80
HTTPS  → Port 443

Linux Firewall (UFW)

Linux firewall protects the OS itself.


sudo ufw status
sudo ufw allow ssh
sudo ufw allow 80
sudo ufw enable

Golden Rule

AWS Security Group + Linux Firewall = Real Security Never rely on only one.

Next: Installing Web Server & Apps →
Disclaimer:
Never open all ports (0.0.0.0/0) in production.