Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Monitor Your Server with htop

htop is an interactive process viewer with colors. See CPU, memory and processes, and manage them from one screen.

VPS and Cloud Servers2 min read7 screenshots

What htop is

htop is a better version of top. It shows the CPU cores, memory, swap, load average and a list of processes, with colors, and lets you scroll and act on processes with the keyboard.

The htop screen

Install it if you do not have it:

sudo apt install htop

On CentOS, Rocky and AlmaLinux use sudo dnf install htop (you may need the EPEL repository first).

Start htop

htop

Press q or F10 to quit.

Common options

OptionMeaning
-d <delay>Refresh time between updates, in tenths of a second
-u <user>Show only the processes of one user
-p <pid>Show only the given process IDs
-s <column>Sort by a column
-tShow processes as a tree
--no-colorPlain, black-and-white mode

Examples

Set the update interval. The delay is in tenths of a second, so 10 means 1 second:

htop -d 10
htop with a custom delay

Show the processes of one user

htop -u linuxuser
Processes of a user

Watch a certain process

htop -p 8759
A single process

Sort by a column

htop -s PID
Sorted by PID

You can use column names such as PERCENT_CPU or PERCENT_MEM.

Show a process tree

htop -t
The process tree

Without colors

htop --no-color
htop without colors

Keys inside htop

KeyAction
Arrow keys, PgUp, PgDn, Home, EndMove through the list
SpaceMark (tag) or unmark a process
URemove all tags
F3 or /Search for a process by name
F4Filter the list
F5 or tSwitch the tree view
F6Choose the sort column
F9Send a signal (kill) to the selected process
F7 / F8Lower or raise the priority (nice value)
P, M, TSort by CPU, memory or time
HShow or hide user threads
F2Open the setup screen
q or F10Quit

Quick recap

  • htop shows the load of the server and each process.
  • Filter with -u and -p, view the tree with -t.
  • Use F9 carefully to stop a process.