- Newest
- Most votes
- Most comments
Hello, Please check the cloudwatch metrics for resources (cpu , memory , iops) of your system once it comes back online and if the resource limits are reaching and the system getting hung due to the heavy application that you are trying to install, then upscale the size of your instance with large cpu & memory , also look for storage full issues and increase the filesystems as well.
One place to start looking would be under the Monitoring tab of the EC2 instance in AWS Console, and note if there is anything that looks concerning, e.g. if CPU usage becomes unusually high.
It would also be worthwhile setting up CloudWatch agent to collect more detailed system logs https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html - this may show that your root cause is exhaustion of some system resources.
What is the EC2 instance type?

Just the basic free one. Is that a problem? I noticed that my cpu was occpied like 99.7% while installing
The free tier instances are very low-spec, which is not a problem until you're doing something that needs a lot of memory as they can quickly run out of it.
Did you manage to install CloudWatch Agent and did it indicate anything in this area that might be of concern.
If it looks like you may be short of memory, a quick fix could be to add more swap space https://repost.aws/knowledge-center/ec2-memory-swap-file