How to Keep Laptop Battery Healthy When Using Linux

Inside every laptop is a ticking time bomb: the battery. Unfortunately, laptop batteries don’t explode (at least not usually) when a certain amount of time passes, but they do deteriorate over time and may even stop working entirely when the deterioration exceeds a certain level.

While laptop battery deterioration can’t be completely avoided, you can greatly slow it down by learning and practicing the essential techniques described in this article.

1. Keep Your Laptop Cool

Modern Lithium-ion batteries perform best when their temperature is between 15 °C and 35 °C. When their temperature gets too low, their capacity is reduced. When their temperature gets too high, a thermal failure may occur.

In practice, your biggest enemy is prolonged exposure to excessive heat, which accelerates battery deterioration. Here are its common causes:

  • Poorly designed ventilation and passive cooling
  • Using the laptop with its lid closed
  • High-demand use cases such as gaming and video editing

To ensure that your laptop doesn’t stay hot for a long time, you should monitor its temperatures and, if necessary, purchase a cooling pad to pull heat away from the battery.

2. Charge Between 30% and 80%

According to Battery University, Lithium-ion batteries shouldn’t be charged above 80% and discharged below 30% of their maximum capacity to increase their lifespan.

Yes, it’s true that some modern laptops automatically limit maximum charging to prevent overcharging, but such features may not always work reliably in Linux.

If you want to be extra safe, then you can manually limit battery charging using TLP:

su -c 'echo 80 > /sys/class/power_supply/BAT0/charge_stop_threshold'

Alternatively, you can simply remind yourself to disconnect your laptop from a charger after the desired charge percentage has been reached and connect it to a charge a long time before the battery becomes completely empty.

3. Change Your Charging Habits

Here’s a surefire way to quickly kill your laptop’s battery:

  1. Take your laptop with your every day to school or work and use it until there’s no juice left.
  2. Take the fully discharged laptop home and use it for the rest of the day while it’s connected to a charger.
  3. Leave the laptop charging over night so that it’s charged to 100% next morning.

Basically, you’re creating the worst charging conditions for your battery possible. Instead, you should be performing shallow charges throughout the day to always keep your battery between 30% and 80%.

An external power bank with laptop charging capabilities makes this fairly easy, and you can get one these days without paying a lot of money.

4. Perform a Full Discharge/Charge Cycle Once a Month

As beneficial as shallow charging is for your battery, it can mess up your battery calibration and cause the battery charge level percentage displayed by your Linux distribution to not match the actual charge level.

To prevent this from happening, you should perform a full discharge/charge cycle approximately once a month. We recommend you create a repeating calendar event so that you don’t forget and are then not surprised when your laptop shuts down unexpectedly.

5. Regularly Check Your Battery Health

There are multiple Linux tools that let you check how healthy your battery is, which is something you should do on a regular basis because a laptop with a dying battery can become unreliable.

One such tool is called upower, a simple command-line client for the UPower daemon that enumerates power sources, maintains statistics and history data on them, and notifies about status changes.

To use to check your battery health, you first need to list all available power devices:

upower -e

You then need to tell upower to display detailed information about your battery:

upower -i /org/freedesktop/UPower/devices/battery_BAT1

The output should look like this:

native-path: BAT1

vendor: Lenovo IdeaPad

model: VIUU4

serial: BAT20103321

power supply: yes

updated: Thu Feb 9 17:30:44 2021 (77 seconds ago)

has history: yes

has statistics: yes


present: yes

rechargeable: yes

state: charging

energy: 11.6345 Wh

energy-empty: 0 Wh

energy-full: 48.4230 Wh

energy-full-design: 52.8532 Wh

energy-rate: 29.9434 W

voltage: 12.234 V

time to full: 76.7 minutes

percentage: 24.0268%

capacity: 91.6179%

technology: lithium-ion

Finally, compare the energy-full (the maximum amount of charge your battery can hold) and energy-full-design (the maximum amount of charge your battery is designed to hold) values to see how much your battery has deteriorated so far (capacity).

If your battery doesn’t have even 50% of its original capacity, then there’s a good chance that it will stop working completely soon, so you should consider replacing it before it happens.


Without a healthy battery, your laptop won’t be any more portable than a regular desktop computer, so you should take good care of it. If practiced diligently, the techniques described in this article can prevent your battery from deteriorating prematurely, but don’t expect them to perform miracles. At the end of the day, all batteries have a limited lifespan before they start performing horribly (usually around 5 years).

About the author

David Morelo

David Morelo is a professional content writer in the technology niche, covering everything from consumer products to emerging technologies and their cross-industry application