Prevent AWS EC2 instance from going to sleep when closing terminal window

I am running a PHP server from an AWS EC2 instance. It seems whenever I close my laptop (which is running a terminal session to the EC2 instance), the EC2 instance goes into sleep mode, and all incoming http requests from remote clients fail.

This is an T2.micro EC2 instance. And Hibernation is not enabled.

What should I do to keep the EC2 instance from going to sleep?


You appear to be using an EC2 instance is created with Cloud9.

The 'hibernation' is a feature of Cloud9, not EC2. Cloud9 is intended to be a development environment -- it is not intended for 'production' usage.

If you want a website to be running at all times, you should really use an EC2 instance that is not created by Cloud9.

However, you can disable the hibernation. See: Changing the auto-hibernate settings on a AWS Cloud9 EC2 Instance