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

SQL Injection Prevention: Complete Security Guide & Best Practices

Your database gets compromised. Customer records disappear. Credit card data ends up for sale on the dark web. SQL injection attacks remain one of the most prevalent web application vulnerabilities in 2024, consistently appearing in top ten

What is Rate Limiting: Definition, Types & Implementation Guide

Your login page just got hammered with 10,000 password attempts in under a minute. Your API servers are buckling under a flood of requests. Legitimate users can't access the service while infrastructure costs spike. Without proper controls,

Types of Virtualization in Cloud Computing

Your physical servers are sitting idle at 15% to 20% CPU utilization while you're paying for 100% of the power, cooling, and hardware costs. Meanwhile, your competitors have consolidated 10 to 15 applications per server, pushing utilization

What Is Server Provisioning? Types & Benefits Explained

Your IT team just got approval for 50 new servers to handle a product launch. Manual setup means weeks of work, and here's the kicker: OS installation alone eats up to 90% of total provisioning time. Meanwhile, your competitors are deployin

What is a CSRF Attack: Definition, Prevention & How It Works

You click a link in what looks like a routine email from your bank, and within seconds, $5,000 vanishes from your account, transferred to a stranger while you were simply logged in to your banking app. Many legacy web applications have vuln

What is Session Hijacking: Definition, Types & Prevention

You've logged into your banking app, checked your balance, and closed the browser. But here's what you don't see: an attacker is now inside your account, moving money and accessing sensitive data, without ever needing your password. Session

Subscribe to our newsletter

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