How To Hibernate Ec2 Instance

How To Articles

Today, I want to share with you my personal experience and insights on how to hibernate an EC2 instance. Hibernating an EC2 instance is a useful feature that allows you to pause and resume your instances, saving both time and money. It’s an incredibly handy tool that I’ve found myself using frequently, so let’s dive deep into the details of how to do it.

What is Hibernation for EC2 Instances?

Hibernation is a feature provided by Amazon Web Services (AWS) that allows you to pause your EC2 instances and resume them later from the same state. When you hibernate an instance, its in-memory state is preserved on the instance store, EBS volume, or EFS file system. This means that when you start the instance again, you can continue exactly where you left off.

Hibernating an EC2 Instance

To hibernate an EC2 instance, follow these steps:

  1. Make sure your instance is running Amazon Linux 2 or Windows Server 2019.
  2. Install the necessary packages or updates to enable hibernation. For Amazon Linux 2, you can use the following command:

sudo yum install -y hibernate-tool

  1. Enable hibernation by entering the following command:

sudo systemctl enable hibernate

After enabling hibernation, you can now hibernate your EC2 instance using the following command:

sudo systemctl hibernate

Once you execute this command, your instance will begin the hibernation process. During this time, the instance’s state will be saved, and all running processes will be paused and written to disk. The instance will then stop.

Resuming a Hibernated Instance

To resume a hibernated instance, simply start it as you would with any other stopped instance. AWS will automatically detect that the instance was previously hibernated and restore it to its previous state. This means that any running processes and data on the instance will be exactly as they were before hibernation.

It’s important to note that there are a few limitations to hibernating an EC2 instance. First, the instance type must support hibernation. Not all instance types have this capability, so be sure to check the AWS documentation for a list of supported instance types.

Additionally, hibernation is only available for instances using the Amazon Linux 2 or Windows Server 2019 operating systems. If you’re using a different operating system, hibernation will not be an option.


In conclusion, hibernating an EC2 instance is a powerful feature that can save you time and money. By preserving the in-memory state of an instance, you can easily pause and resume your work, allowing you to pick up right where you left off.

However, it’s important to keep in mind the limitations of hibernation, such as supported instance types and operating systems. As long as you meet the requirements, hibernation can be a valuable tool in your EC2 instance management arsenal.

So go ahead and give hibernation a try, and experience the convenience and efficiency it brings to your AWS workflow.