dnf install epel-release && dnf install htop on AlmaLinux, Rocky Linux and CloudLinux, or apt install htop on Debian and Ubuntu. Run htop, press P to sort by CPU or M to sort by memory, F4 to filter, F5 for a tree view and F9 to stop a process. Press F10 or q to quit.Why use htop instead of top
htop shows the same information as top, but it is easier to read and to work with. You get colour bars for each CPU core, memory and swap, you can scroll through every process, search and filter by name or user, see parent and child processes in a tree, and stop or reprioritise a process without typing its PID.
Install htop
# AlmaLinux, Rocky Linux, CloudLinux, RHEL (from EPEL)
dnf install -y epel-release
dnf install -y htop
# Fedora
dnf install -y htop
# Debian and Ubuntu
apt update && apt install -y htop
# Arch Linux
pacman -S htop
# openSUSE
zypper install htop
# FreeBSD
pkg install htop
Check the version with htop --version. Current distributions ship htop 3.x.
Read the htop screen
The header
| Part | What it shows |
|---|---|
| Numbered bars | Use of each CPU core. Green is normal user processes, red is kernel time, blue is low-priority processes. |
| Mem | Memory in use. Green is used by programs, blue is buffers, and yellow or orange is file cache, which Linux frees when programs need it. |
| Swp | Swap in use. Steady swap use on a busy server is a sign that it needs more memory. |
| Tasks | Number of processes and threads, and how many are running right now. |
| Load average | Average number of processes running or waiting, over 1, 5 and 15 minutes. |
| Uptime | Time since the last reboot. |
Compare the load average with the number of CPU cores. A load of 4 on a 4-core server means the CPUs are fully used. A load well above the core count means processes are waiting, often for disk or CPU.
The process columns
| Column | Meaning |
|---|---|
| PID | Process ID |
| USER | The account that owns the process. On cPanel servers this shows which hosting account is busy. |
| PRI / NI | Priority and nice value. A higher nice value means a lower priority. |
| VIRT | Virtual memory reserved by the process. Usually much larger than real use. |
| RES | Real memory in use. This is the column to watch. |
| SHR | Memory shared with other processes. |
| S | State: R running, S sleeping, D waiting for disk, Z zombie. |
| CPU% / MEM% | Share of CPU and memory used right now. |
| TIME+ | Total CPU time used since the process started. |
| Command | The program and its arguments. |
Keyboard shortcuts
| Key | Action |
|---|---|
| P / M / T | Sort by CPU, memory or running time |
| F6 or < > | Choose the sort column |
| F3 or / | Search for a process |
| F4 or \ | Filter the list by name |
| u | Show only one user’s processes |
| F5 or t | Tree view of parent and child processes |
| H / K | Hide or show user threads and kernel threads |
| Space | Tag a process, to act on several at once |
| F9 or k | Send a signal to the selected or tagged processes |
| F7 / F8 | Raise or lower the priority (nice value) |
| l / s | List open files (lsof) or trace system calls (strace), if installed |
| F2 | Setup: choose meters, columns and colours |
| F10 or q | Quit |
Start htop with options
htop -u nobody # only processes owned by one user
htop -p 1234,5678 # only these process IDs
htop -t # start in tree view
htop -s PERCENT_MEM # sort by memory
htop -d 50 # refresh every 5 seconds (delay in tenths of a second)
Find what is slowing a server down
- Press P. If a few processes use most of the CPU, note the user and command.
- Press M. If RES is high and swap is in use, the server is short of memory.
- Look at the S column. Many processes in state D point to slow disk I/O rather than CPU.
- On cPanel servers, check the USER column to see which hosting account owns the busy PHP or MySQL processes.
- Press F5 to see which parent process started them, for example a cron job or a web server.
Stop a process safely
Select the process, press F9, and choose a signal. Try 15 SIGTERM first: it asks the program to exit cleanly and save its work. Use 9 SIGKILL only if the process does not respond, because it stops the process at once. Do not kill system services such as sshd, mysqld or httpd from htop. Restart them with systemctl restart instead.
For ongoing monitoring with alerts and history, see our guide to real-time Linux server monitoring.
Need help with this?
Server always busy? Our team can find the cause and tune your VPS or dedicated server.
Frequently asked questions
Is htop installed by default?
Not on most server installs. Install it from your distribution’s packages. On AlmaLinux and Rocky Linux it comes from EPEL.
What is the difference between VIRT and RES?
VIRT is the memory a process has reserved, much of which it may never use. RES is the memory it actually uses right now.
Why is my memory bar almost full?
Linux uses free memory as file cache, shown in yellow or orange. That memory is released when programs need it, so a full bar is not always a problem.
What does a high load average mean?
More processes are running or waiting than the CPUs can handle. Compare the load with the number of CPU cores.
Can I use htop on shared hosting?
Usually not. Shared hosting accounts do not have SSH access to the whole server. Use cPanel’s resource usage page instead.
Related guides
- How to Install Linux Malware Detect (LMD)
- How to Install RKHunter on Linux (RootKit Hunter) in RHEL, CentOS and Fedora
- Install FFmpeg on AlmaLinux, Debian, CentOS, and Ubuntu (Updated Guide)
- Real-Time Linux Server Monitoring: Tools, Setup & Enterprise Solutions for Sysadmins
- Updated MARCH 2025: Essential SSH Commands for Linux Server Management
