Maximize Your Laptop Battery Life on Ubuntu 24.04

As our computers get faster and more capable, they often use more power, leading to shorter battery life. While the number of apps you’re running plays a role, many laptop users find battery duration a common headache,

especially when they can’t stay plugged in all day.

Battery icon illustration

 

Good news, though! You can often squeeze out more battery time with some software adjustments and smart usage habits. Besides potentially switching to a less demanding desktop environment, Ubuntu laptop users have a great tool available called TLP, designed specifically for power management.

In this guide, I’ll walk you through what TLP is and show you exactly how to get it set up on your Ubuntu laptop. We’ll cover installation, basic usage, dive deep into various commands for checking system status and managing power, and also share some handy tips to help you further optimize your laptop’s power usage for longer unplugged sessions.

What Exactly is TLP?

TLP is a fantastic free and open-source tool packed with features, specifically designed to improve battery life on laptops running Linux distributions like Ubuntu.

You don’t need to be a Linux guru to benefit from it. TLP works behind the scenes, tapping into advanced Linux power management capabilities. Essentially, when your laptop is running on battery, TLP automatically tweaks hardware settings to use less power. Here’s a glimpse of what it can manage:

  • Offers numerous customization options and power-saving parameters.
  • Provides USB autosuspend feature (with an option to exclude specific devices).
  • Manages kernel laptop mode and dirty buffer timeouts.
  • Handles Power management for PCI Express Active State (PCIe ASPM).
  • Improves power awareness for multi-core/hyper-threading process scheduling.
  • Supports processor “turbo boost” or “turbo core” frequency scaling adjustments.
  • Manages runtime power for PCI(e) bus devices.
  • Includes power-saving modes for Wi-Fi and audio hardware.
  • Features advanced power management for traditional hard drives (non-SSD), including spin-down timeouts (configurable per disk).
  • Supports Radeon graphics power management (KMS and DPM).
  • Manages SATA Aggressive Link Power Management (ALPM).
  • Includes an I/O scheduler setting (configurable per disk).

TLP Power Management Features

The great part is that TLP comes with sensible default settings that are already optimized for better battery performance. You usually don’t need to change anything! The main configuration file lives at /etc/default/tlp if you’re curious or need specific tweaks. TLP caters to everyone, offering both a Command Line Interface (CLI) for terminal users and a Graphical User Interface (GUI) for those who prefer visuals. Just install it, and it starts working!

Installing TLP (Command Line Method)

First things first, let’s open a terminal. You can usually do this by pressing Ctrl+Alt+T or searching for “Terminal” in your application launcher.

Before installing new software, it’s always a good idea to update your package list. Run this command:

sudo apt-get update

This command fetches the latest information about available packages from the software repositories. You’ll need administrator privileges, hence the `sudo`.

Before installing tlp, run the command below :

   sudo add-apt-repository ppa:linrunner/tlp

Now, to install TLP itself, use the following command:

sudo apt update && sudo apt install tlp
sudo apt install tlp

 

You’ll likely be asked to confirm the installation (Y/N). Just type ‘Y’ and press Enter. The installation process might take a few moments, depending on your internet speed. Once done, TLP is installed!

TLP is designed to start automatically when your system boots up and run as a background service. You can verify if it’s active with this command:

sudo systemctl status tlp
sudo systemctl status tlp

Using TLP via the Command Line

The command line offers powerful ways to interact with TLP, check its status, view system information, and even manually control its behavior.

Starting TLP Manually

Although TLP starts automatically on boot, if you need to manually start or apply its settings (for example, after changing configuration or to exit manual mode), you can use:

sudo tlp start

This command applies the appropriate profile (AC or BAT) based on the current power source and enables automatic mode.

sudo tlp start

Checking Status and System Information (`tlp-stat`)

The `tlp-stat` command is your primary tool for seeing what TLP is doing and gathering power-related system information. Here are some common uses:

  • Overall System Status: Get a comprehensive overview of TLP status and relevant system information.

    sudo tlp-stat -s
    # or
    sudo tlp-stat --system

    sudo tlp-stat -s

    Linux battery life status check

  • Battery Details: View detailed reports about your laptop battery/batteries.

    sudo tlp-stat -b
    # or
    sudo tlp-stat --battery

    You can add `-v` or `–verbose` to potentially see battery voltages.

    sudo tlp-stat -b -v

    sudo tlp-stat -b

    Ubuntu battery drain check information

  • Active Configuration: See the TLP configuration settings currently in effect.

    tlp-stat -c
    # or
    tlp-stat --config
    tlp-stat -c
  • Configuration Differences: Show only the settings you’ve changed compared to the defaults.

    tlp-stat --cdiff
  • Disk Information: Check power management status for your disk drives.

    sudo tlp-stat -d
    # or
    sudo tlp-stat --disk
  • PCIe Devices: View power state information for PCI Express devices. Use `-v` for runtime status.

    sudo tlp-stat -e
    # or
    sudo tlp-stat --pcie
    sudo tlp-stat -e -v
  • Graphics Card Info: Display power management details for your graphics card(s).

    sudo tlp-stat -g
    # or
    sudo tlp-stat --graphics
  • Processor Details: Show CPU frequency scaling and power-related information. Add `-v` to see details for all CPU cores, not just cpu0.

    sudo tlp-stat -p
    # or
    sudo tlp-stat --processor
    sudo tlp-stat -p -v
  • Radio Devices: Check the status (enabled/disabled) of radio devices like Wi-Fi, Bluetooth, WWAN.

    tlp-stat -r
    # or
    tlp-stat --rfkill
  • Temperatures and Fan: Display system temperatures and fan speed (if available).

    tlp-stat -t
    # or
    tlp-stat --temp

    sudo tlp-stat -t

    Ubuntu laptop / PC CPU temperature check

  • USB Devices: Show information about connected USB devices and their autosuspend status. Use `-v` for runtime power status.

    tlp-stat -u
    # or
    tlp-stat --usb
    tlp-stat -u -v

Verbosity and Output Control:

  • Use `-v` or `–verbose` with many `tlp-stat` commands (like `-b`, `-e`, `-p`, `-u`) to get more detailed output.
  • Use `-q` or `–quiet` (Version 1.7+) to get less output, omitting the version header and reducing processor info.
  • Check your installed TLP version (Version 1.7+):
    tlp-stat --version

Manually Controlling TLP Profiles and Devices (`tlp` command)

Besides checking status, the `tlp` command lets you manually apply settings or control specific devices:

  • Apply Battery Profile: Force TLP to apply battery settings, regardless of whether AC power is connected. This also enters ‘manual mode’.

    sudo tlp bat
  • Apply AC Profile: Force TLP to apply AC power settings, even if running on battery. This also enters ‘manual mode’.

    sudo tlp ac

    Important Note on Manual Mode: When you use `tlp bat` or `tlp ac`, TLP stops automatically switching profiles when you plug/unplug the power adapter. It stays in the manually selected mode until the next reboot or until you run `sudo tlp start` again to resume automatic switching.

  • Apply USB Autosuspend: Manually trigger USB autosuspend for eligible devices (those not excluded in your configuration).

    sudo tlp usb
  • Power Off Optical Drive: If your laptop has a removable optical drive (CD/DVD) in a MediaBay or Ultrabay slot, this command powers it off completely.

    sudo tlp bayoff

    Note: To power the drive back on, you usually need to physically eject and reinsert it or press its eject button. This command doesn’t affect other devices like hard drives in those bays.

Advanced Battery Care Functions (`tlp` command)

TLP offers features to help manage battery health, primarily through charge thresholds. Important: The availability and specific options for battery care depend heavily on your laptop’s manufacturer, model, Linux kernel version, and TLP version. Always consult the official TLP documentation for specifics about your hardware.

Note for Laptops with Two Batteries: If you have two batteries (often BAT0 and BAT1), you might need to specify which battery the command applies to. Check `tlp-stat -b` to see your battery identifiers.

  • Temporarily Set Charge Thresholds: Change the start and stop charging percentages temporarily. The configured thresholds from `/etc/default/tlp` will be restored on the next boot or if you run `tlp setcharge` without arguments.

    sudo tlp setcharge [ ] []

    Example for setting thresholds to 70% start and 90% stop for the main battery (BAT0):

    sudo tlp setcharge 70 90 BAT0

    To make these changes permanent, you must edit the `TLP_START_CHARGE_THRESH_BAT0` and `TLP_STOP_CHARGE_THRESH_BAT0` (and BAT1 if applicable) settings in `/etc/default/tlp`.

  • Charge Fully Once: Temporarily override thresholds to allow the battery to charge to 100%.

    sudo tlp fullcharge []

    Example for the secondary battery (BAT1):

    sudo tlp fullcharge BAT1

    Hint: The command sets the thresholds and exits; it doesn’t wait for charging to complete.

  • Charge to Stop Threshold Once: Temporarily lifts only the start threshold, allowing charging to begin immediately (if below the stop threshold) and continue until the configured stop threshold is reached.

    sudo tlp chargeonce []
  • Discharge Battery (on AC): Force the battery to discharge, even while plugged in. Useful for calibration or specific testing.

    Version 1.8 and newer:

    sudo tlp discharge [] [<target_level_%>]

    Version 1.7 and older:

    sudo tlp discharge []

    Without a target level, it discharges fully. The command shows progress and can be stopped with Ctrl+C. Charging resumes automatically once discharged (or target level reached).

  • Recalibrate Battery (on AC): Perform a full discharge cycle followed by allowing a full recharge to help the battery controller recalibrate its capacity estimates.

    sudo tlp recalibrate []

    Example for BAT0:

    sudo tlp recalibrate BAT0

    Important: This command discharges the battery and then terminates. You must leave the AC adapter plugged in afterwards to allow the battery to charge fully to 100% to complete the recalibration. This process helps update the ‘full charge capacity’ value shown in `tlp-stat -b` but does not repair worn-out batteries.

Utility and Diagnostics Commands

  • Show Disk IDs: Display the IDs TLP uses for your configured disk drives (useful for configuration).

    tlp diskid
  • Monitor Power Events: Watch for udev events related to power supply changes (plugging/unplugging AC).

    sudo tlp-stat -P
    # or
    sudo tlp-stat --pev
  • Power Supply Diagnostics: View diagnostic information about the power supply.

    tlp-stat --psup
  • Trace Output: View detailed trace output for debugging TLP operations.

    sudo tlp-stat -T
    # or
    sudo tlp-stat --trace
  • Check Udev Rules: Verify if TLP’s udev rules (for detecting power source changes and USB events) are active.

    tlp-stat --udev
  • SATA Warnings: Show warnings related to SATA disk configurations or potential issues.

    tlp-stat -w
    # or
    tlp-stat --warn
  • Show TLP Version: Display the installed TLP version.

    tlp --version  # (Version 1.7+)
    # or
    tlp-stat --version # (Version 1.7+)

Uninstalling TLP

If you decide you want to remove TLP from your system, you can do so using:

sudo apt-get remove tlp

Using TLP with a Graphical Interface (GUI)

If you prefer managing settings through a visual interface rather than the terminal, there’s a separate GUI application for TLP called TLPUI that can be installed from Github.

Read: Display Your Graphics Card Details on Ubuntu 24.04: A Terminal Command Guide 

Final Thoughts on TLP

We’ve covered installation methods and a wide range of commands for TLP on your Ubuntu system. This powerful utility should help you manage your laptop’s battery consumption more effectively, giving you more unplugged time. Hopefully, once TLP is running, you’ll notice an improvement in how long your battery lasts between charges. For even more in-depth details about TLP and all its options, check out the official TLP website here.

More Practical Tips to Improve Your Laptop Battery Life

Beyond using tools like TLP, here are some everyday habits and adjustments that can help improve your average laptop battery lifespan and optimize its usage.

Unplug or Turn Off Unused Peripherals

Remember that your laptop provides power to everything connected via USB – webcams, external drives, mice, keyboards, even USB keys. If you’re not actively using a USB device while on battery, simply unplugging it can save a bit of power. Every little bit helps!

Similarly, if your laptop has a physical switch or function key to disable the built-in webcam, use it when not needed. Muting your speakers can also prevent small power drains from system notification sounds.

Lower Screen Brightness

Your laptop’s screen is often one of the biggest power consumers. That bright, clear display requires significant energy.

Laptop brightness control keys illustration

Interestingly, the relationship between brightness level and power consumption isn’t linear. Increasing brightness at lower levels uses less additional power than increasing it when it’s already high.

The simple trick here is to turn down the brightness whenever possible. Avoid using full brightness unless necessary. Even dropping the brightness by a third can save a noticeable amount of power (around 1 Watt on some typical laptops).

Minimize CPU Wakeup Events

Some applications or background processes can frequently wake up an idle CPU, causing unnecessary power drain. Things like animated web elements or specific background tasks can be culprits. If you notice specific apps causing frequent CPU activity (tools like `htop` or `powertop` can help identify these), consider closing them when not needed or finding alternatives. For web pages, simply closing unused browser tabs can make a difference.

Consider a Lightweight Desktop Environment

Standard Ubuntu uses the GNOME desktop environment, which is feature-rich but can be relatively resource-intensive. Ubuntu offers official “flavors” with lighter desktop environments like Lubuntu (LXQt) or Xubuntu (XFCE). These require less processing power and graphics capability, potentially saving battery.

You can install a lightweight desktop alongside your current one. For example, to install the Lubuntu desktop:

sudo apt-get install lubuntu-desktop

After installation, you can choose which desktop environment to load from the login screen.

Similarly, look for lightweight alternatives to common applications if power saving is critical. For instance, use a simpler text editor instead of a full office suite for basic notes, or a less resource-heavy image viewer.

Disable Wi-Fi When Not Needed

Your laptop’s wireless networking adapter is another significant power consumer. Even when not connected to a network, the Wi-Fi chip uses power scanning for available networks.

Wi-Fi symbol

If you don’t need an internet connection, turning off Wi-Fi is an easy way to save battery. On most Ubuntu systems, you can do this easily:

  • Click the system menu (usually top-right corner).
  • Find the Wi-Fi connection section.
  • Select ‘Turn Off’ or enable ‘Airplane Mode’.

Alternatively, you can use the terminal:

  • To turn Wi-Fi off:
    nmcli radio wifi off
  • To turn Wi-Fi back on:
    nmcli radio wifi on

For more network manager command-line options, check its help:

  • nmcli radio help
  • nmcli radio wifi help

Address High Memory Usage

While you might only be actively using a few applications, numerous background services could be running and consuming resources, including memory and CPU cycles, which indirectly drains the battery. Examples might include desktop effects (like Compiz), indexing services, or background update checkers.

A good strategy is to identify and disable unnecessary services that start automatically when you boot your system. We have discussed ways to tackle high memory usage in Linux, which can also contribute to power savings. You can find more information here:

Conclusion

We’ve explored several tools and techniques to help you extend your Ubuntu laptop’s battery life. Installing and running the TLP utility provides automatic, efficient power management specifically tuned for Linux systems. By understanding its status commands (`tlp-stat`) and control commands (`tlp`), including the useful battery care functions, you can gain fine-grained insight and control. Combining TLP with good habits like dimming your screen, unplugging unused USB devices, and managing background processes can make a significant difference in how long you can stay productive while unplugged.


Frequently Asked Questions (FAQ)

Q1: How can I check the current TLP configuration being used on my Ubuntu laptop?
A: You can view the active configuration settings TLP is currently using by running the command `tlp-stat -c` or `tlp-stat –config` in your terminal. To see only the settings you’ve changed from the defaults, use `tlp-stat –cdiff`.
Q2: What command shows detailed battery health and charge thresholds in TLP?
A: Use `sudo tlp-stat -b` or `sudo tlp-stat –battery`. This command provides a detailed report including manufacturer data, capacity, charge level, current status (charging/discharging), and importantly, the currently active start and stop charge thresholds if supported and configured.
Q3: How do I temporarily set battery charge limits using TLP commands in Ubuntu?
A: Use the `sudo tlp setcharge <start_%> <stop_%> []` command. For example, `sudo tlp setcharge 60 80 BAT0` sets the main battery to start charging below 60% and stop at 80%. These settings are temporary and reset on reboot or by running `sudo tlp setcharge BAT0` without percentages. For permanent changes, edit `/etc/default/tlp`.
Q4: Is there a TLP command to check the power status of specific hardware like my graphics card or PCIe devices?
A: Yes! To check graphics card power management details, use `sudo tlp-stat -g` (`–graphics`). For PCIe devices, use `sudo tlp-stat -e` (`–pcie`). Adding the `-v` (`–verbose`) flag often provides more detail, such as runtime power status for PCIe and USB devices (`sudo tlp-stat -u -v` for USB).
Q5: What is the difference between `tlp start`, `tlp bat`, and `tlp ac` commands?
A: `sudo tlp start` applies the appropriate profile (AC or battery) based on the current power source and ensures TLP is in automatic mode (reacting to power source changes). `sudo tlp bat` forces the battery profile and puts TLP in manual mode (ignoring power source changes until `tlp start` or reboot). `sudo tlp ac` forces the AC profile and also puts TLP in manual mode.
Q6: How can I troubleshoot TLP if I suspect it’s not working correctly on Ubuntu?
A: Start by checking the overall status with `sudo tlp-stat -s`. Look for warnings with `tlp-stat -w`. Check if the udev rules are active with `tlp-stat –udev`. For deeper issues, you can monitor power events with `sudo tlp-stat -P` or view detailed debugging logs with `sudo tlp-stat -T`.
Q7: Can TLP recalibrate my Ubuntu laptop battery, and how do I do it?
A: Yes, TLP can initiate a recalibration cycle on supported hardware using `sudo tlp recalibrate []`. This command fully discharges the battery while on AC power, then terminates. You *must* leave the laptop plugged in afterward to allow a full charge to 100% to complete the process. This helps the battery controller report capacity more accurately but doesn’t fix degraded cells.

 


If you like the content, we would appreciate your support by buying us a coffee. Thank you so much for your visit and support.

 

Nikolaus Oosterhof

Nikolaus holds a degree in software development and has a strong passion for all things tech-related, especially gadgets with screens. Though he is nostalgic for older phone models, he's a retired gamer and continues to enjoy programming in open-source environments. Additionally, Nikolaus enjoys writing about Linux, macOS and Windows and has experience designing web pages.

Leave a Reply