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

What is TLS 1.3?

TLS 1.3 is the latest version of the Transport Layer Security protocol, standardized in RFC 8446 in August 2018. This cryptographic protocol secures communication between clients and servers across the internet, from web browsing to API cal

What is DNS load balancing?

DNS load balancing is a technique that distributes incoming network traffic across multiple servers by manipulating DNS responses to improve the availability and performance of applications or services. It works at the application layer (la

What is an SSL handshake?

An SSL handshake, more accurately called a TLS handshake, is a process that establishes a secure encrypted connection between a client (like a web browser) and a server before any data transfer begins. As of 2024, over 95% of HTTPS websites

What is API Rate Limiting?

API rate limiting is the process of controlling how many requests a user or system can make to an API within a specific timeframe. This mechanism caps transactions to prevent server overload and ensures fair distribution of resources across

What is Bot Mitigation?

Bot mitigation is the process of detecting, managing, and blocking malicious bots or botnet activity from accessing websites, servers, or IT ecosystems to protect digital assets and maintain a legitimate user experience. Malicious bots acco

What is GEO DNS?

GeoDNS is a DNS server technology that returns different IP addresses based on the geographic location of the client making the request. This enables geographic split-horizon DNS responses, directing users to servers closest to their physic

Subscribe to our newsletter

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