First check if hibernation is compatible with your computer
You should save all of your work before hibernating the computer, just in case something goes wrong and your open applications and documents cannot be recovered when you switch on the computer again.
Run this in a console
{CODE()}
sudo pm-hibernate
{CODE}
Enter your password when prompted.
After you computer turns off, switch it back on. Did your open applications re-open?
If hibernate doesn't work, check if your swap partition is at least as large as your available RAM.
If the hibernate test works, you can continue to use the sudo pm-hibernate command when you want to hibernate.
You can also enable the hibernate option in the menus. To do that, use your favorite text editor to create
{CODE()}
sudo nano /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
{CODE}
Add the following to the file and save:
{CODE()}
[Re-enable hibernate by default]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
{CODE}
Alternatively, if the previous doesn't work for some reason, you can edit this file:
{CODE()}
sudo nano /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla
{CODE}
Search for the sections related to "hibernate", and set __ResultActive=no__ to __ResultActive=yes__
{CODE()}
[Disable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
[Disable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=yes
{CODE}
__Re-enable hibernate in xfce panels__
See http://www.bio.brandeis.edu/~shaikh/linux/suspend.htm
{CODE()}
sudo nano /etc/polkit-1/localauthority/50-local.d/com.ubuntu.desktop.pkla
{CODE}
Content to add:
{CODE()}
[Re-enable hibernate by default]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
{CODE}