Gaming industry under DDoS attack. Get DDoS protection now. Start onboarding
  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

Web Scraping Protection: Complete Guide to Detection, Prevention & Best Practices

Your server load suddenly spikes by 400%. Legitimate customers can't access your site. Competitors are methodically copying your product descriptions, pricing data, and proprietary content. Modern scraping bots are draining your resources a

What is WAF: Complete Guide to Web Application Firewall Security

Your web application just processed what looked like a normal login request, but it was actually an SQL injection attack that exposed your entire customer database. Cross-site scripting (XSS), SQL injection, and other application-layer atta

Application Layer DDoS Attacks: Detection, Prevention & Mitigation

Your network dashboards show green. Bandwidth utilization is at 5%. Yet your application is dying, response times spike to 30 seconds, users get timeout errors, and your on-call engineer can't figure out why. Welcome to application layer DD

What is an IXP?

When you send an email or stream a video, your data doesn't just magically hop from your computer to its destination. It travels through multiple networks, and somewhere along that path, it might passes through an Internet Exchange Point (I

What is global server load balancing (GSLB)?

Global server load balancing is a traffic management system that distributes user requests across servers in multiple geographic locations to improve performance and reliability. This approach can reduce latency by 40-60% compared to single

Edge Functions: How They Work, Benefits, and Use Cases

When you're building a web application, there's a good chance you've faced this problem: your server sits in one location, but your users are scattered across the globe. That means someone in Tokyo waits longer for a response than someone i

Subscribe to our newsletter

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