Htop provides real-time visibility into system processes, CPU usage, memory consumption, and load averages through an interactive terminal interface. For example, common use cases include identifying CPU-intensive processes that slow down your system, monitoring memory usage to catch leaks before they crash applications, and killing frozen or runaway processes directly from the viewer. By the end of this guide, you will have htop installed and ready to monitor your Debian system, along with the knowledge to navigate its interface, use command-line options for automation, and manage processes effectively.
Update System Packages
First, refresh your package index and upgrade existing packages before installing new software. This step ensures you receive the latest available version of htop and resolves potential dependency conflicts:
sudo apt update && sudo apt upgrade
The apt update command downloads the latest package information from your configured repositories, while apt upgrade applies any available updates to your installed packages.
Install Htop
Since htop is available in Debian’s default repositories across all supported versions, you can install it directly using APT without adding any third-party sources:
sudo apt install htop
Here, the sudo prefix grants the necessary administrative privileges to install system-wide packages. If you need to configure sudo access, see our guide on adding a user to sudoers on Debian.
Additionally, htop suggests optional packages that enhance its functionality:
lm-sensorsfor CPU temperature monitoring,lsoffor detailed file descriptor information, andstracefor system call tracing. Install these withsudo apt install lm-sensors lsof straceif you need these features.
Verify the Installation
Next, after installation completes, confirm that htop is accessible by checking its version. This step verifies the installation succeeded and shows which version your system received:
htop --version
htop 3.4.1
Your version number will vary depending on your Debian release. For instance, Debian 13 (Trixie) includes htop 3.4.x, Debian 12 (Bookworm) includes 3.2.x, and Debian 11 (Bullseye) includes 3.0.x. However, all versions share the same core functionality; newer versions simply add features like container awareness and additional display columns.
Now that htop is installed, run it from the terminal to start monitoring your system. The interface displays immediately and updates in real time:
htop
Once launched, htop presents a color-coded overview of CPU cores, memory usage, swap usage, and a scrollable list of all running processes. The header meters at the top provide at-a-glance system health information, while the process list below shows detailed information about each running task.

Navigate the Process List
Htop provides intuitive keyboard controls for browsing and sorting processes:
- Up/Down Arrow Keys: Move through the process list to select individual processes.
- Left/Right Arrow Keys: Scroll horizontally to view additional process columns like CPU usage, memory consumption, and priority.
- F6: Open the sort menu to order processes by CPU usage, memory, process ID, or other criteria.
- F5: Toggle the tree view to visualize parent-child relationships between processes.
Manage Processes
Beyond monitoring, htop allows you to control processes directly from the interface:
- F9: Send signals to the selected process. Choose SIGTERM (15) to request graceful termination, SIGKILL (9) to force immediate termination, or SIGHUP (1) to trigger a configuration reload.
- F7/F8: Adjust the process priority (nice value). Lower values give higher priority; higher values reduce priority. This helps balance system resources among competing processes.
Search and Filter Processes
When monitoring systems with many running processes, use the search and filter functions to locate specific items:
- F3: Search by process name. Type the name and press Enter to highlight matching processes in the list.
- F4: Filter the process list to show only processes matching your criteria, such as a specific username or command name.
Customize the Display
Htop stores its configuration in ~/.config/htop/htoprc, and you can modify settings through the setup menu:
- F2: Open the setup menu to customize display options, meter layouts, color schemes, and which columns appear in the process list. Changes save automatically to your configuration file and persist across sessions.
Exit Htop
To close htop and return to your terminal prompt, press either F10 or Q. Your customization settings persist for future sessions.
Command-Line Options
In addition to the interactive interface, htop accepts command-line arguments that let you customize its behavior. These options are particularly useful for scripting, quick checks, and setting defaults when you launch:
Start with Tree View
To display processes in a hierarchical tree showing parent-child relationships, use the -t flag. This view helps you understand which processes spawned others:
htop -t
Sort by CPU or Memory
Alternatively, launch htop with processes already sorted by a specific column. For example, to sort by CPU percentage (highest first):
htop -s PERCENT_CPU
Likewise, sort by memory usage to quickly identify memory-hungry processes:
htop -s PERCENT_MEM
Filter by User
To show only processes owned by a specific user, use the -u flag. This is especially helpful on multi-user systems or when tracking down processes running under a particular service account:
htop -u www-data
Simply replace www-data with any username. Alternatively, omitting the username (htop -u) filters to your own processes.
Monitor Specific Processes
Furthermore, you can track specific processes by their PIDs. This is useful when you want to focus on particular services without the noise of other system processes:
htop -p 1234,5678
Replace the numbers with actual process IDs. You can find PIDs using pgrep or pidof.
Set Update Delay
Finally, you can change how frequently htop refreshes its display. The delay is specified in tenths of a second. For instance, to update every 2 seconds instead of the default 1.5 seconds:
htop -d 20
As a result, slower refresh rates reduce CPU usage, which can matter when monitoring resource-constrained systems.
Troubleshoot Common Issues
Command Not Found After Installation
If you receive a “command not found” error immediately after installation, your shell may not have refreshed its command cache. Start a new terminal session, or run:
hash -r
This command clears the shell’s cached command locations and consequently forces it to search the PATH again.
Display Issues Over SSH
When connecting to a remote Debian server via SSH, htop may display incorrectly if your terminal emulator settings do not match the remote environment. Ensure your terminal supports 256 colors and that the TERM environment variable is set correctly:
export TERM=xterm-256color
htop
For persistent configuration, add the export TERM=xterm-256color line to your ~/.bashrc file on the remote server.
Permission Denied for Process Signals
Attempting to kill or renice processes owned by other users requires root privileges. If htop shows “Permission denied” when sending signals, launch htop with sudo:
sudo htop
As a result, running as root gives you control over all system processes, including those owned by system services and other users.
Missing Temperature or Sensor Data
If htop does not display CPU temperature in the header meters, you need to install and configure lm-sensors:
sudo apt install lm-sensors
sudo sensors-detect
Accept the defaults during detection, then restart htop. Afterward, enable temperature display through the F2 setup menu by adding the temperature meter to your header layout.
Remove Htop
If you no longer need htop, remove it along with any automatically installed dependencies that are no longer required:
sudo apt remove htop
sudo apt autoremove
The apt remove command uninstalls the htop package, while apt autoremove cleans up orphaned dependencies such as ncurses libraries that were installed specifically for htop.
Next, to verify removal succeeded:
htop --version
bash: htop: command not found
Optionally, to also delete your personal htop configuration and cached settings:
rm -rf ~/.config/htop
Conclusion
You now have htop installed on your Debian system with the ability to monitor processes, track resource usage, and manage running tasks interactively. The keyboard shortcuts and command-line options covered here provide efficient navigation for both interactive sessions and scripted monitoring scenarios.