In this tutorial, we'll learn how to install & configure Psensor, lm-sensors on Ubuntu 24.04.
We’ll set up reliable temperature monitoring on Ubuntu 24.04 LTS using lm-sensors for detection and Psensor for graphs and alerts. Because servers don’t ship with a desktop, we’ll run psensor-server for a lightweight web/remote setup. We’ll also cover kernel modules for disk temps and service hardening.
Notes we care about:
- Ubuntu Server images install without a GUI. So we’ll keep everything terminal-first and optional web UI.
- Psensor and psensor-server are in the Ubuntu 24.04 repositories.
- hddtemp is deprecated/removed; use the kernel drivetemp module for HDD/SSD temperatures.
- sensors-detect supports a non-interactive --auto mode.
Prerequisites
Before we begin, ensure we have the following:
- An Ubuntu 24.04 on dedicated server or KVM VPS.
- Basic Linux Command Line Knowledge.
1) Update the server and install packages
sudo apt update
sudo apt install -y lm-sensors psensor psensor-server
lm-sensors provides the sensors CLI and detection script. psensor is the GTK app (handy for a desktop admin), and psensor-server exposes a JSON/Web endpoint so we can view readings remotely.
2) Detect available sensors safely
Interactive (lets us see what it finds):
sudo sensors-detect
Accept the defaults unless we know our hardware well.
Automated (good for scripted builds):
sudo sensors-detect --auto
This probes, recommends kernel modules, and offers to persist them so they load at boot. The --auto flag answers defaults for us.
3) Load sensor modules and verify readings
Load common modules immediately without reboot:
# CPU packages
sudo modprobe coretemp # Intel
sudo modprobe k10temp # AMD
# Motherboard Super I/O chips (examples; sensors-detect will advise)
sudo modprobe nct6775
sudo modprobe it87 2>/dev/null || true # if supported on our board
# Disks: modern replacement for removed hddtemp
sudo modprobe drivetemp
Make them persistent at boot:
# Create a dedicated modules-load file
echo -e "coretemp\nk10temp\nnct6775\ndrivetemp" | sudo tee /etc/modules-load.d/sensors.conf
Confirm sensor data:
sensors
If we see “No sensors found,” re-run sensors-detect, ensure the suggested modules are loaded, and check lsmod | egrep 'coretemp|k10temp|nct|it87|drivetemp'. Disk temperatures appear via hwmon when drivetemp is loaded.
4) Quick, no-GUI monitoring (CLI)
For a live watch on a server shell:
watch -n 2 sensors
watch refreshes every 2 seconds so we can stress-test and observe temps in real time.
5) Headless web monitoring with psensor-server
psensor-server publishes a minimal HTTP JSON API that psensor can consume remotely, and we can also curl it for quick checks.
5.1) Create a systemd service
Create psensor-server.service file:
nano /etc/systemd/system/psensor-server.service
Add following content:
[Unit]
Description=Psensor Server (hardware sensors web service)
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
# Listen on 0.0.0.0:3131; drop or change -i to bind to a private address if needed
ExecStart=/usr/bin/psensor-server -p 3131 -i 0.0.0.0
User=nobody
Group=nogroup
NoNewPrivileges=true
ProtectSystem=full
ProtectHome=true
PrivateTmp=true
CapabilityBoundingSet=
AmbientCapabilities=
Restart=on-failure
[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable --now psensor-server
sudo systemctl status psensor-server --no-pager
The service provides JSON on port 3131 by default. We can reverse proxy behind Nginx or bind to a private interface for safety. psensor-server is packaged for Ubuntu 24.04.
5.2) Test locally and from our admin machine
# On the server
curl http://127.0.0.1:3131/sensors
Open the port on UFW if we’re reaching it remotely:
sudo ufw allow 3131/tcp
sudo ufw status
6) Optional: View graphs from a desktop with Psensor
On our admin workstation (Ubuntu desktop):
sudo apt update
sudo apt install -y psensor
Launch Psensor, add a remote host, point it at http://SERVER_IP:3131, and select the sensors to display. psensor consumes the psensor-server JSON endpoint for remote graphs and alerting.
7) Optional: NVIDIA GPU temperatures
Install NVIDIA tools on the machine with the GPU:
sudo apt install -y nvidia-settings
Psensor can read NVIDIA temps via XNVCtrl when available.
8) Helpful tuning and troubleshooting
Service hardening: we limited privileges in the unit file. Adjust the bind address with -i or reverse proxy with HTTPS if exposed.
Sensor names and scaling: some chips expose multiple temp inputs. Use sensors to identify CPU package vs core temps and hide noisy entries in the Psensor UI.
Missing disk temps: ensure drivetemp is loaded; for NVMe, smartctl -A /dev/nvme0 | grep -i -E 'temp|temperature' can confirm firmware reporting. drivetemp is the supported path on modern Ubuntu releases replacing the old hddtemp approach.
Autoload modules cleanly: stick to /etc/modules-load.d/*.conf and avoid editing legacy files directly; systemd-modules-load reads these at boot.
9) Sanity checklist
# 1) Packages present
dpkg -l | egrep 'lm-sensors|psensor|psensor-server'
# 2) Drivers loaded
lsmod | egrep 'coretemp|k10temp|nct|it87|drivetemp'
# 3) Readings look correct
sensors
# 4) Web endpoint alive
curl -s http://127.0.0.1:3131/sensors | head
Why this approach works for Ubuntu 24.04
- Packages are in the Noble repositories and maintained for the release.
- We avoid deprecated hddtemp, using the kernel’s drivetemp for HDD/SSD support.
- Headless servers get a minimal, scriptable JSON endpoint through psensor-server, while desktops can attach for charts and alerts.
This setup gives our team dependable CLI monitoring, remote graphs, and clean boot-time behavior without dragging a full desktop onto the server.
