Improving Notebook Battery Life in Ubuntu with TLP

TLP is a free, open-source, and feature-rich utility for optimizing battery consumption on laptops running Ubuntu and other Linux distributions. You can find it in both CLI and GUI versions for your convenience. TLP comes with a default configuration that is pretty much perfect for your operating system and the underlying machine. All you need to do is install and activate the utility, and you're ready to go. The utility optimizes the power consumption of hardware devices when your laptop is running on battery and not on AC power.

In this article, we'll explain how to enable TLP on your Ubuntu machine to save battery power:

  1. TLP Command Line Interface
  2. TLP User Interface Utility

We ran the commands and procedures mentioned in this article on an Ubuntu 20.04 LTS system.

Install and Use the TLP CLI

Open your Ubuntu command line, the Terminal, either through the system Application Launcher search or the Ctrl+Alt+T shortcut.

The next step is to update your system’s repository index through the following command:

$ sudo apt-get update

This will help you install the latest available version of the software from the Internet.

Please note that only an authorized user can add, remove and configure software on Ubuntu. Please enter the following apt-get command as sudo to install the TLP on your system:

$ sudo apt-get install tlp

Install tlp

The system may prompt you to continue the installation by typing Y/N. Please type Y if you want to continue with the installation. The process may take some time to install the TLP on your system depending on your internet speed.

Now you are ready to use TLP. First, let's see how to start the utility with the following command; the command starts the TLP service on your system:

$ sudo tlp start

Start tlp

You following TLP command lets you view detailed system information and also the status of the TLP utility:

$ sudo tlp-stat -s

TLP stat

TLP, by default, works according to a preset configuration that is pretty much best suited for your operating system and hardware. You can view this configuration through the following command:

$ sudo tlp-stat -c

View configuration

Another very useful command is to print the detailed battery report through TLP. Use the b flag with the tlp-stat command to view this information:

$ sudo tlp-stat -b

Get detailed battery report

Remove TLP

If you ever feel like removing this utility from your system, you can so so through the following command as sudo:

$ sudo apt-get remove tlp

Remove TLP

Enter y on the y/n prompt and the software will be completely removed from your system.

Install and Use the TLP UI

For those more interested in the user interface, there is a user interface for the TLP utility. Here's how to install it from the Linux Uprising PPA via the command line.

Open the Terminal application and run the following command to add the PPA through which you want to install the TLP UI. We do this because the TLP UI is not available through the official Ubuntu repositories, nor through the Snap Store.

$ sudo add-apt-repository ppa:linuxuprising/apps

Add apt repository

Next, enter the following command in order to update the local repository index with that of the Internet repositories:

$ sudo apt-get update

Now you are ready to install the TLP UI. Enter the following apt-get command as sudo to do so:

$ sudo apt-get install tlpui

Install tlpui

The system may prompt you to continue the installation by typing Y/N. Please type Y if you want to continue with the installation. The process may take some time depending on your internet speed. After that TLP UI will be installed on your system.

Now you can launch and use the utility.

You can launch the TLP UI from the system application launcher as follows:

TLP UI

Or, by entering the following command in the Terminal.

$ tlpui

This is what the TLP UI looks like. The Configuration tab lets you view and edits the TLP settings. Whereas, the Statistics tab lets you view system and battery use statistics.

Start TLPUI program

The most important button here is the TLP_ENABLE slider On and Off button. Through this button, you can enable/disable battery optimization through TLP, based on your configuration.

Remove TLP

If you ever want to remove the utility from your Ubuntu, you can do so by entering the following command in your Terminal:

$ sudo apt-get remove tlpui

You can also get rid of the added PPA by running the following command:

$ sudo rm /etc/apt/sources.list.d/linuxuprising-ubuntu-apps-bionic.list

So those were two ways you can make the most efficient use of your Ubuntu system's battery. Once you enable the TLP service, you will notice that your battery life will increase, which is otherwise a common problem with laptops running Ubuntu.