How to install Discourse in the AWS EC2 Instances(Ubuntu Server LTS)?

As said above AWS behaves differently to other hosts.

DigitalOcean servers are available over the Internet by default.

AWS servers sit in private networks and aren’t available publicly by default.

You’ve not said anything in the above which suggests you’ve published your EC2 instance or that the FQDN is pointed to the external IP.