Htop is an interactive process viewer that helps you identify CPU-hogging applications, track memory leaks in real-time, and kill unresponsive processes without leaving your terminal. Unlike the classic top command, htop provides color-coded displays, mouse support, and the ability to sort, filter, and manage processes with simple keystrokes. Whether you need to troubleshoot a slow system, monitor resource usage during development, or manage remote servers efficiently, htop gives you immediate visibility into what your system is doing.
Most Ubuntu desktop installations include htop by default, but minimal server deployments and cloud images often omit it. The sections below cover how to install htop on Ubuntu with APT or Snap, navigate the interface, manage process priorities, and customize the display for your workflow.
Update Ubuntu Before Installing htop
Before installing htop, update all existing Ubuntu packages to maintain stability, security, and compatibility with new software:
sudo apt update && sudo apt upgrade
If your Ubuntu user account does not have sudo privileges, visit our guide on how to add a user to sudoers on Ubuntu before continuing.
Choose Your htop Installation Method on Ubuntu
Ubuntu offers two primary methods to install htop: the default APT repository provides stable, well-tested versions, while Snap delivers newer upstream releases with automatic updates. Choose based on whether you prioritize stability or access to the latest features.
| Method | Channel | Version | Updates | Best For |
|---|---|---|---|---|
| APT (recommended) | Ubuntu default repository | 3.0.x–3.4.x | Distribution cycle | Most users seeking stable, tested packages |
| Snap | Upstream maintainer | 3.3.x+ | Automatic, frequent | Users who want the newest upstream features |
APT is recommended for most users because it integrates directly with Ubuntu’s package management and receives security patches through standard system updates. Choose Snap only if you need features from an upstream release that has not yet reached Ubuntu repositories.
Install htop with APT
Install htop from the default Ubuntu repository:
sudo apt install htop
Verify the installed version:
htop --version
htop 3.4.1
The output displays your installed htop version. Ubuntu 26.04 ships htop 3.4.1, Ubuntu 24.04 includes 3.3.0, and Ubuntu 22.04 provides 3.0.5. All features in this guide work with any 3.x release.
Install htop with Snap
Alternatively, the Snap version delivers newer htop releases directly from the upstream maintainer. Since Ubuntu includes Snap by default, you can install immediately:
sudo snap install htop
Verify the Snap installation:
snap list htop
Name Version Rev Tracking Publisher htop 3.3.0 3524 latest/stable maxiberta✪
The Snap version runs in a confined environment with limited system access by default. To enable full system monitoring capabilities, connect optional interfaces:
sudo snap connect htop:mount-observeandsudo snap connect htop:network-controlfor advanced network statistics.
Use htop to Monitor and Control Processes
Htop uses function keys and arrow keys to navigate, sort, and control processes. The interface also responds to mouse clicks for column sorting and process selection. Press F1 inside htop at any time to open the built-in help screen.
Launch htop
Start htop from any terminal:
htop
To monitor only your own processes, launch htop with a user filter:
htop -u $USER
Interactive htop interface displaying system metrics:

The top section displays CPU cores, memory usage, swap usage, and system load averages. Below that, the process list shows PIDs, users, CPU/memory consumption, and command details. You can navigate with arrow keys or click processes with your mouse.
Navigate and Sort Processes
Use arrow keys and function keys to navigate the process list and change sort order:
| Key | Action |
|---|---|
| Up/Down | Move through the process list |
| Left/Right | Scroll columns to view additional metrics |
| F6 | Open sort menu to choose CPU, memory, PID, or other columns |
| F5 | Toggle tree view to show parent-child process relationships |
Click any column header with your mouse to sort by that metric, or use F6 for keyboard-only navigation.
Kill and Reprioritize Processes
Control misbehaving or resource-intensive applications directly from htop:
| Key | Action | When to Use |
|---|---|---|
| F9 → SIGTERM (15) | Gracefully terminate a process | First choice for frozen applications that stop responding |
| F9 → SIGKILL (9) | Force immediate termination | Process ignores SIGTERM and refuses to close |
| F9 → SIGHUP (1) | Reload configuration without restarting | Apply config changes to daemons like Nginx or Apache |
| F7 | Increase priority (lower nice value) | Give a critical task more CPU time |
| F8 | Decrease priority (higher nice value) | Throttle background tasks competing for resources |
Search and Filter Processes
Quickly locate specific processes with search and filter functions:
| Key | Action | Example |
|---|---|---|
| F3 | Search by name; highlights the first matching process | Type nginx to jump to the Nginx worker process |
| F4 | Filter the list to show only matching processes | Type your username to isolate your own processes |
Customize htop Display
Press F2 to open the setup menu where you can customize meters, color schemes, and column layouts. All changes save automatically to ~/.config/htop/htoprc and persist across sessions. Common customizations include:
- Adding meters for disk I/O, network activity, or battery status
- Rearranging columns to prioritize CPU, memory, or I/O metrics
- Switching color schemes for better visibility on light or dark terminals
The htop setup menu for customizing display options:

Exit htop
Press F10 or Q to exit htop.
htop Command-Line Options
Htop accepts command-line flags that narrow the display to specific processes, adjust refresh rates, or run non-interactively for scripted workflows.
Monitor Specific Processes
Track specific process IDs without distraction from other system activity:
htop -p 1234,5678,91011
Replace the numbers with actual PIDs you want to monitor. This narrows the display to only those processes, which is useful when debugging specific applications.
Adjust Update Frequency
By default, htop refreshes every second. Reduce CPU overhead on resource-constrained systems by slowing the update rate:
htop -d 30
The -d flag sets the delay in tenths of seconds. In this case, the example updates every 3 seconds instead of every second.
Use htop in Scripts
Run htop non-interactively to capture process snapshots:
htop --no-mouse --readonly -n 1
The --readonly flag prevents accidental process modifications, while -n 1 (or --max-iterations=1) exits after one iteration. You can then combine these flags with output redirection for automated monitoring scripts.
Uninstall htop from Ubuntu
Uninstall htop using the same method you used for installation.
Uninstall htop (APT)
If you installed htop via APT, remove it along with any unused dependencies:
sudo apt remove htop && sudo apt autoremove
Verify the removal:
htop --version
bash: htop: command not found
Uninstall htop (Snap)
If you installed htop via Snap:
sudo snap remove htop
User-specific htop settings are stored in
~/.config/htop/htoprcand persist after uninstallation. Remove this directory manually if you want to clear customized color schemes, column layouts, or meter configurations.
Troubleshoot Common htop Issues
Most htop installations complete without issues, but the following solutions address common problems.
Package Not Found Error
If APT reports that htop is unavailable, your package cache may be outdated:
E: Unable to locate package htop
To resolve this, update the package cache and retry:
sudo apt update
sudo apt install htop
Then verify the installation succeeded:
htop --version
htop 3.4.1
Terminal Display Issues
If htop displays garbled characters or incorrect colors, your terminal may lack proper Unicode or 256-color support. Test with the no-color mode:
htop --no-color
If monochrome mode works correctly, consider switching to a modern terminal emulator that supports full UTF-8 and color rendering. Meanwhile, check your current terminal capabilities:
echo $TERM
xterm-256color
Modern terminals report xterm-256color or similar. If your terminal reports xterm or linux, consider upgrading to a terminal like GNOME Terminal, Konsole, or Terminator.
Permission Denied When Changing Process Priority
Regular users can only adjust nice values for their own processes within restricted ranges. To modify system processes or increase priority (lower nice values), run htop with elevated privileges:
sudo htop
Verify you can adjust priority by selecting a process and pressing F7 or F8. The nice value should now change without permission errors.
Incorrect CPU Count on Virtual Machines
Virtual machines sometimes report incorrect CPU topology in htop. If you see more cores than your VM actually has, this reflects the host’s physical CPU configuration rather than your VM’s allocation. The CPU usage percentages remain accurate even if the core count appears wrong.
Slow Process List Updates
If htop feels sluggish or lags behind actual system activity, increase the update frequency:
htop -d 5
This updates every 0.5 seconds instead of the default 1 second. Watch the CPU meter in htop itself. If the update frequency causes noticeable CPU spikes, increase the delay value. Faster updates consume more resources, so only use shorter intervals when you need real-time precision for active troubleshooting.
Ubuntu desktop editions typically include htop as a pre-installed package. However, minimal server installations, cloud images, and Docker containers usually omit it. Run htop --version to check. If you see “command not found,” install it with sudo apt install htop.
Both tools display running processes, but htop adds color-coded CPU and memory meters, mouse support, built-in process search and filtering, tree view, and the ability to kill or reprioritize processes without typing PIDs. The top command ships with every Linux distribution and uses fewer resources, making it better suited for extremely constrained environments or scripts that parse its output.
By default, htop does not display per-process disk I/O or network statistics. You can add basic I/O read/write columns through F2 (Setup), but for detailed disk and network monitoring, use complementary tools like iotop for disk I/O or nmon on Ubuntu for combined system metrics.
Without sudo privileges, you cannot install htop through APT or Snap system-wide. However, you can compile htop from source into your home directory using ./configure --prefix=$HOME/.local followed by make and make install. This lets you run htop without elevated permissions.
Conclusion
You now have htop installed on Ubuntu and can identify resource-hungry processes, terminate frozen applications with F9, and filter by user or application name with F4. Press F2 to customize meters and save your preferred layout. For remote server monitoring, install SSH on Ubuntu and run htop over secure connections to diagnose performance issues from anywhere.
Formatting tips for your comment
You can use basic HTML to format your comment. Useful tags:
<code>command</code>command<pre>block of code</pre><strong>bold</strong><em>italic</em><a href="URL">link</a><blockquote>quote</blockquote>