Skip to content
Log In Sign Up info@muvcloud.com

Install htop

On Ubuntu and Debian:

sudo apt update
sudo apt install htop

On AlmaLinux and Rocky Linux, htop comes from the EPEL repository:

sudo dnf install epel-release
sudo dnf install htop

Start it with htop, or sudo htop to manage processes of other users. Press q or F10 to quit.

The Screen at a Glance

  • CPU meters: one bar per CPU, numbered from 0 or 1 depending on the settings.
  • Mem and Swp: memory and swap in use.
  • Tasks, Load average, Uptime: process and thread counts, the 1, 5, and 15 minute load, and time since boot.
  • Process list: PID, user, priority, memory columns, state, CPU and memory percent, CPU time, and the command.

The columns mean the same as in top; the top command guide explains each one.

Function Keys

KeyWhat it does
F1Help, with the color legend
F2Setup: meters, columns, colors
F3Search by name
F4Filter the list
F5Tree view
F6Choose the sort column
F7, F8Raise or lower priority
F9Send a signal
F10Quit

If your terminal or SSH client catches the function keys, use the letter keys instead: / to search, \ to filter, t for tree view, k to send a signal. You can also click column headers and bottom labels with the mouse.

Sort, Filter, and Tree View

  • Sort: P by CPU, M by memory, T by CPU time, or F6 for any column.
  • Filter: F4, then type part of a name such as php; only matching lines stay. Press F4 and clear the text to undo.
  • One user: u and pick the user from the list.
  • Tree: F5 shows which process started which, useful for web server and database workers.
  • Threads: H hides or shows user threads, K kernel threads.

Send a Signal Safely

  1. Select the process with the arrow keys, or tag several with the space bar.
  2. Press F9. A list of signals opens with 15 SIGTERM selected.
  3. Press Enter to send SIGTERM, which asks the program to stop cleanly.
  4. Wait and watch whether the line disappears. Choose 9 SIGKILL only if it does not, and never as the first step on a database.

A process that belongs to a service should be stopped with systemctl stop, or systemd may start it again. The full order is in how to kill a process in Linux.

What the Colors Mean

In the default color scheme, the CPU bar shows low-priority (niced) work in blue, normal user programs in green, kernel time in red, and steal time in cyan. The segments of the memory bar depend on the htop version and the system, and colors change with the scheme chosen in F2, so press F1: the help screen shows the legend for your version and settings.

Start Options

htop -u deploy
htop -p 1234,5678
htop -d 20

These show one user's processes, watch selected PIDs, and set the refresh delay in tenths of a second. Settings you change in F2 are saved in ~/.config/htop/htoprc when you quit. To find a PID first, see how to list processes.

Updated:

Linux VPS with Full Root Access

MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.

Cloud VPS Plans Starting at2.99 $/mo Cheap Linux VPS

No Limits on Service or Support

You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

Support specialist
  • 100% customer satisfaction goal
  • Our own hardware
  • 24/7 ticket and email support
  • 4 countries with locations