> For the complete documentation index, see [llms.txt](https://knowledge.tracelog.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledge.tracelog.in/linux-and-core/linux/improve-and-optimize-battery-life-on-linux.md).

# Improve and optimize battery life on Linux

### Goal

Maximum battery life on linux within reasonable and acceptable daily workloads

Case study: `Thinkpad x240` with `9cells` battery on `ubuntu 16.04`

* Before: from 100% to 5% - \~ `3.5hours`
* After installing **TLP**: \~ `5hours`&#x20;

### Solution

**TLP** brings you the benefits of advanced power management for Linux without the need to understand every technical detail. TLP comes with a default configuration **already optimized for battery life**, so you may **just install** and forget it. Nevertheless, TLP is highly customizable to fulfill your specific requirements.

**Please note**: `TLP` runs on every laptop brand. Setting the battery charge thresholds is available for IBM/Lenovo ThinkPads only.

### Installation

```
# Add PPA
sudo add-apt-repository ppa:linrunner/tlp
sudo apt-get update

# Especially for thinkpad
sudo apt-get install tp-smapi-dkms acpi-call-dkms

# Install
sudo apt-get install tlp tlp-rdw
```

**Start:** `TLP` will start automatically. To avoid having to restart the system, the first time you can start it manually by using the following command:

```
sudo tlp start
```

**Check:** Use the `tlp-stat` terminal command to check if TLP is working properly

```
▶ sudo tlp-stat -s
[sudo] password for devops: 
--- TLP 1.0 --------------------------------------------

+++ System Info
System         = LENOVO ThinkPad X240 20AMS1WY00
BIOS           = GIET75WW (2.25 )
Release        = Ubuntu 16.04.2 LTS
Kernel         = 4.10.0-27-generic #30~16.04.2-Ubuntu SMP Thu Jun 29 16:07:46 UTC 2017 x86_64
/proc/cmdline  = BOOT_IMAGE=/boot/vmlinuz-4.10.0-27-generic.efi.signed root=UUID=34cadb32-d632-4d98-a4a8-a1c53753dc35 ro quiet splash vt.handoff=7
Init system    = systemd v229
Boot mode      = UEFI

+++ TLP Status
State          = enabled
Last run       = 10:41:53 PM,   3685 sec(s) ago
Mode           = battery
Power source   = battery
```

### Reference

<http://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://knowledge.tracelog.in/linux-and-core/linux/improve-and-optimize-battery-life-on-linux.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
