Knowing how your server uses CPU, memory, disk, and network is essential for capacity planning and troubleshooting. This guide covers the most useful monitoring commands and tools on Ubuntu 24.04 LTS.
Tested and valid on:
- Ubuntu 24.04 LTS
Prerequisites
- Ubuntu 24.04 LTS server
- A user with sudo privileges
Step 1 – Quick Overview with top
The built-in top command shows real-time CPU and memory usage:
top
Press q to exit. Sort by CPU with P or memory with M.
Step 2 – Install and Use htop
htop is an improved interactive process viewer:
sudo apt install htop -y
htop
Step 3 – Check Memory Usage
Quick memory summary:
free -h
Virtual memory statistics:
vmstat 1 5
Step 4 – Check Disk Usage
Show disk space by file system:
df -h
Find largest directories:
du -sh /var/* 2>/dev/null | sort -rh | head -10
Step 5 – Check Disk I/O
Install sysstat for iostat:
sudo apt install sysstat -y
iostat -xz 1 5
Step 6 – Check Network Traffic
Real-time bandwidth with nload:
sudo apt install nload -y
nload
List active connections:
ss -tuln
Step 7 – Install Glances
All-in-one system dashboard:
sudo apt install glances -y
glances
Step 8 – System Load and Uptime
Check uptime and load average:
uptime
CPU and core info:
lscpu | grep -E 'CPU|Thread|Core|Socket'
Conclusion
You now have a toolkit of monitoring commands for Ubuntu 24.04 LTS. For persistent monitoring with alerting and historical graphs, consider Prometheus with Grafana or Netdata — both covered in later tutorials in this series.