Private networks first
Most providers give each account one or more private networks. Resources inside a private network reach each other without crossing the public internet, which is both faster and safer.
A good default is to keep databases and internal services on the private network only, and expose a single public entry point in front of them.
Firewalls and ports
A firewall decides which traffic may reach a resource. Open the smallest set of ports the service needs, restrict the sources where you can, and review the rules whenever architecture changes.
Outbound mail is a recurring special case. Several providers restrict SMTP ports on new accounts to limit abuse, so applications that send email are commonly pointed at a dedicated sending service instead of talking SMTP directly from an instance.
Load balancing and DNS
A load balancer spreads requests across several instances and removes unhealthy ones from rotation. DNS maps a name to whatever address is currently correct. Together they are what lets infrastructure change underneath a stable public address.


