Gaming industry under DDoS attack. Get DDoS protection now. Start onboarding

Products

  1. Home
  2. Developers
  3. How to Check CPU temperature on Linux

How to Check CPU temperature on Linux

  • By Gcore
  • September 12, 2023
  • 2 min read
How to Check CPU temperature on Linux

In today’s high-demand digital environments, keeping tabs on your computer’s health is crucial. One vital metric, often overlooked, is the CPU temperature, which can greatly influence performance and longevity. If you’re a Linux user, understanding how to monitor this temperature can help ensure your system operates efficiently and safely. This guide will walk you through the processes and tools you need to keep an eye on your Linux CPU’s thermal state.

Why is Monitoring CPU Temperature Important?

Overheating can result in issues such as system throttling (where the system deliberately slows down to prevent damage), unexpected shutdowns, and even long-term damage to hardware components. Additionally, here are other potential consequences:

  1. Performance. High temperatures can lead to throttling, which directly impacts system performance. By maintaining an optimal temperature, you ensure your system runs smoothly and efficiently.
  2. Longevity. Constant exposure to high temperatures can reduce the lifespan of your CPU and other system components.
  3. Safety.  Extremely high temperatures can cause system components to fail or even cause physical damage. There have been cases where overheating has led to fires, though they are rare.

Checking the CPU temperature on Linux

Here’s the guide on how to check the CPU temperature on Linux:

#1 Update Your System

Keeping your system updated ensures you have the latest drivers and software packages, which can be essential for accurate hardware readings.

sudo apt update && sudo apt upgrade -y

#2 Install lm-sensors

‘lm-sensors’ is a widely used tool in the Linux ecosystem for monitoring hardware temperatures, fan speeds, and voltages.

sudo apt install lm-sensors

#3 Detect Sensors

After installation, you need to run a detection command. This will detect the sensors on your system and configure ‘lm-sensors’ to read them.

sudo sensors-detect

Follow the on-screen prompts, answering ‘YES’ to most questions to ensure all sensors are detected.

#4 Check CPU Temperature

Now that ‘lm-sensors’ is set up, you can read the temperatures of your CPU and other components.

sensors

This command will display a readout of various system temperatures, fan speeds, and other readings. Look for entries labeled “Core” to see individual core temperatures for multi-core CPUs.

#5 Install Psensor

This is an optional step. If you prefer a graphical representation of temperature and other system metrics, ‘psensor’ provides a user-friendly interface.

sudo apt install psensor

After installation, launch ‘psensor’ from the application menu. It’ll display a graphical representation of your system’s temperatures, including the CPU.

#6 Regular Monitoring

It’s a good practice to check the CPU temperature periodically, especially if you’re performing heavy tasks or notice your system behaving strangely. Monitoring tools can help you identify patterns or spikes in temperature.

That’s all! Now that you’ve learned how to monitor the CPU temperature on Linux, you’re better equipped to maintain a healthy system that performs at its best. Following the outlined steps will empower users to understand their machine’s thermal behavior and make knowledgeable choices.

Conclusion

Looking to deploy Linux in the cloud? With Gcore Cloud, you can choose from Basic VM, Virtual Instances, or VPS/VDS suitable for Linux:

Choose an instance

Related articles

CDN Caching: What It Is and How It Works

Every second of load time costs you. During a traffic spike, an uncached origin server can buckle under the pressure, and CDN caching can offload 70% to 90% of that traffic before it ever reaches your Gcore infrastructure. For a user in New

What Is an Edge Server?

Picture an autonomous vehicle doing 70 mph on the highway, waiting on a response from a data center hundreds of miles away. Or a surgeon depending on real-time imaging that freezes mid-procedure because data has to make a round trip across

What is Cache Hit Ratio and How Can You optimize It?

Every cache miss is a trip your server didn't need to make. And those trips add up fast. Sites with poorly optimized caching can see cache hit ratios as low as 70%, meaning three in 10 requests are hitting your origin server directly, dragg

What Is a High Availability Server?

Every minute your servers are down, your business is bleeding. For e-commerce sites, healthcare platforms, and revenue-critical applications, an outage isn't just an inconvenience. It's a direct hit to your bottom line, your reputation, and

Cloud vs Dedicated Server: Which Is Right for You?

Your server choice could be quietly costing you, or quietly holding you back. Pick the wrong infrastructure for your workload and you're either overpaying for idle hardware every month or watching your site buckle under traffic spikes you c

VPS vs Dedicated Server
VPS vs Dedicated Server: Which One Do You Need?

Your site is humming along fine, until it isn't. Traffic spikes, page loads crawl, and your hosting plan buckles under pressure right when it matters most. Choosing between a VPS and a dedicated server isn't just a technical checkbox. It's

Subscribe to our newsletter

Get the latest industry trends, exclusive insights, and Gcore updates delivered straight to your inbox.