I actually have 2 questions
1) How can I keep the website hosted on Amazon Cloud AWS EC2 (Ubuntu 18.0.4) running despite closing the project/being idle? Every single time after being idle and not working on the project it just stops hence I have to restart the Mongodb and the node app.js
2) How can I actually assign an actual domain such as www.example.com for the website running on Amazon Cloud ?
Thanks
Cloud 9 exists for development purposes. You will get a temporary shell.
You should take a look at EC2 if a VM is what you want. This will grant you a public IP that you can set a DNS record against.