Linux Tutorials

How to Enable Hibernate in Ubuntu Linux

hibernate linux

Are you doing multi-tasking on your Linux machine and suddenly there is a power cut? Is your Laptop battery low or have any problem with your PC’s UPS? Then Hibernate is a good option for you! You can save all your work and resume where you left after switching on the computer.

What is Hibernate?

Hibernate is an option that allows you to save your system state immediately to your hard disk, so that when you switch on back then all the programs can be restored from the hard disk and you can start working again with the same system state as you had before switching off, without losing any data.

Hibernate saves all of your RAM data on the hard disk and restores back into RAM after you turn on the computer.

In Ubuntu, Hibernate is not enabled by default, so you will have to do it manually. But don’t worry It will not take much time once you fulfill the requirements.

Before we continue there are some important things to know to enable Hibernate.

Why Hibernate is not enabled?

When Hibernate can save work in an emergency then why it’s not enabled by default. Well, Hibernate does not work properly with many hardware configurations in Ubuntu and other Linux distributions. If hibernate does not work properly then this might cause data loss after switching back on from hibernation. So PCs or Laptops capable of enabling hibernate option can enable it manually.


Recently, I have seen some users complaining about this tutorial not working for them. It could be a hardware-related issue.

Many have reported this working for them. Let me know if it works or does not work for you.

Is my Hardware is Capable of Hibernate?

You can simply know if your system works properly with hibernate or not. Simply save all your work (otherwise you’ll lose work if hibernate does not work properly) and Open up Terminal from dash or ctrl+alt+t.

how to open terminal in linux ubuntu

Type and run the following command in Terminal.

$ sudo pm-hibernate

As you run the command, your computer will switch off. Switchback on and see if all your programs that were running before switching off are still running. If all programs are running then Hibernate is working properly.

There is one more common problem. As I told you above hibernate saves all your RAM data to the swap partition that you configured when you installed Ubuntu. That’s why the swap partition must be more than or equal to RAM. To check your swap partition open ‘System Monitor’.

system monitor to enable hibernate

In the Resources Tab check your RAM and Swap. If swap is more then you’re good to go, Otherwise, if you still need to enable hibernate then run gparted from a live cd and increase Swap memory.

linux hibernate option RAM and swap memory

Enable Hibernate in System Menu

The indicator session was updated to use logind instead of upower. Hibernate is disabled by default in both upower and logind.

Run the following commands to enable hibernate.

$ sudo -i
$ cd /var/lib/polkit-1/localauthority/50-local.d/
$ gedit com.ubuntu.enable-hibernate.pkla

Tips: if the config file does not work for you, try another one by changing /var/lib to /etc in the code.

Copy and paste the below lines to the file and save it.

[Re-enable hibernate by default in upower]
[Re-enable hibernate by default in logind]
linux hibernation feature script

Log out or Restart your system and you’ve done. After you log in, you’ll see hibernate option in your system Menu above in the tray.

hibernate in linux ubuntu


Derek March 8, 2020 at 8:11 pm

This does not work in Linux Mint 19.

Suraj Meena June 15, 2020 at 9:49 pm

Neither in ubuntu 20[LTS]

Andrea_S August 7, 2020 at 2:17 am

I think you don’t want to edit localauthority in /var, create a new file like

Arm_Channel September 29, 2020 at 8:19 am

This works perfectly on my Xubuntu set up. Thank you. However, the system resets itself every time after I run System Updates. Is there a way to script it so that it won’t reset after running System Update?

Ben June 30, 2021 at 8:58 am

Yeah, doesn’t work for me either on Ubuntu 20.04.2 .. just goes into hibernate and reboots when I bring it back out.

John T. July 13, 2021 at 7:30 pm

Well, it still doesn’t work in Mint 20.2. As Ben reported, it reboots instead of restoring the previous session. Any fresh ideas?


Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.