> ## Documentation Index
> Fetch the complete documentation index at: https://help.freakhosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# htop Explained: How to Monitor Server Resources on Linux

> htop explained: install it, read the CPU, memory and swap bars, load average and process columns, then sort, filter, search and kill processes on a Linux server.

htop is an interactive process viewer for Linux. Install it with `sudo apt install htop` (Ubuntu/Debian) or from EPEL with `sudo dnf install htop` (AlmaLinux/Rocky), then run `htop`. The top shows one bar per CPU core, memory, swap, tasks and load average; below is every process. Press `P` to sort by CPU, `M` by memory, `F4` to filter, `F9` to kill and `q` to quit.

| Difficulty | Time | Works on | Needs |
| - | - | - | - |
| Beginner | 10 minutes | Ubuntu, Debian, AlmaLinux, Rocky Linux and most other distributions | SSH access; sudo to install |

## Before you start

* [Connect with SSH](https://help.freakhosting.com/portals/other/how-to-connect-to-a-linux-server-with-ssh.md).
* Commands use `sudo`. If you are logged in as root, leave it out.
* htop only reads information unless you press a key that changes something (kill, renice). Start it with `htop --readonly` if you want to rule that out.

## How to install htop

> [tab] Ubuntu / Debian
>
> ```bash theme={null}
> sudo apt update
> sudo apt install htop
> ```

> [tab] AlmaLinux / Rocky
>
> htop is in the EPEL repository (Extra Packages for Enterprise Linux), not the base repositories.
>
> ```bash theme={null}
> sudo dnf install epel-release
> sudo dnf install htop
> ```

Check the version with `htop --version`. Ubuntu 24.04 ships htop 3.3.0.

## How to read the htop screen

Run `htop`. The screen has a header (meters) and a process list.

```text theme={null}
    0[||||||                       6.5%] Tasks: 27, 61 thr, 61 kthr; 1 running
    1[|||||||||||||               18.7%] Load average: 0.66 0.46 0.45
  Mem[||||||||||||||||||    909M/7.84G] Uptime: 00:38:42
  Swp[                           0K/0K]
```

| Meter | What it tells you |
| - | - |
| `0`, `1`, … | One bar per CPU core (vCPU on a VPS), with the percentage in use |
| `Mem` | RAM in use out of the total. Cache is shown in the bar but is freed when programs need it |
| `Swp` | Swap in use. `0K/0K` means the server has no swap |
| `Tasks` | Processes, user threads (`thr`), kernel threads (`kthr`) and how many are running right now |
| `Load average` | Average demand over 1, 5 and 15 minutes. See [what load average means](https://help.freakhosting.com/portals/other/what-is-load-average-on-linux.md) |
| `Uptime` | Time since the last boot |

The bars use colours for different kinds of use. Press `F1` to see the legend for your colour scheme. It reads `CPU usage bar: [low/normal/kernel/guest used%]` and `Memory bar: [used/shared/compressed/buffers/cache used/total]`. A CPU bar that is mostly **kernel** time or a memory bar that is mostly **used** (not cache) is worth a closer look.

## What the htop columns mean

| Column | Meaning |
| - | - |
| `PID` | Process ID, used by `kill` and other tools |
| `USER` | Owner of the process |
| `PRI` / `NI` | Kernel priority and nice value. Nice runs from `-20` (highest priority) to `19` (lowest) |
| `VIRT` | Virtual memory the process has reserved. Often far larger than real use; usually ignore it |
| `RES` | Resident memory: physical RAM the process is really using |
| `SHR` | Part of `RES` that is shared with other processes |
| `S` | State: `R` running, `S` sleeping, `D` waiting for disk (uninterruptible), `Z` zombie, `T` stopped |
| `CPU%` | Share of one core. A busy multi-threaded program can show more than 100% |
| `MEM%` | `RES` as a percentage of total RAM |
| `TIME+` | Total CPU time used since the process started |

> [!NOTE]
>
> `CPU%` above 100 is normal. On a 4-core server, one process can reach 400%. It means the program uses several cores, not that something is broken.

## How to find the busiest processes

**1. Sort by CPU or memory**

Press `P` to sort by `CPU%`, `M` by `MEM%` or `T` by `TIME+`. Press `F6` to pick any column, and `I` to reverse the order.

**2. Filter the list**

Press `F4` and type part of a name, for example `nginx`. Only matching processes stay on screen. Press `F4` then `Esc` to clear it.

**3. See which program started what**

Press `F5` for the tree view. Child processes appear under their parent, which helps with web servers, PHP-FPM pools and game server wrappers.

**4. Show only one user**

Press `u` and choose a user, for example `www-data` or `alex`.

**5. Hide threads**

Press `H` to hide user threads so each program appears once.

You can also start htop already sorted or filtered:

```bash theme={null}
htop -s PERCENT_MEM      # sort by memory
htop -u alex             # only alex's processes
htop -F nginx            # only commands containing "nginx"
htop -d 20               # refresh every 2 seconds (value is in tenths)
```

## How to kill or slow down a process in htop

**1. Select the process**

Move to it with the arrow keys, or press `F3` and type part of its name.

**2. Send a signal**

Press `F9`. `SIGTERM` (15) is selected first and asks the program to close cleanly. Press `Enter`. Use `SIGKILL` (9) only if it doesn't stop.

**3. Or lower its priority**

Press `F8` to raise its nice value so other processes get the CPU first. Only root can lower the nice value again (`F7`).

> [!WARNING]
>
> Killing the wrong process can stop your website, database or SSH session. Run htop as your normal user when you only want to look, and stop services with `sudo systemctl stop name` rather than `F9`. See [kill a process](https://help.freakhosting.com/portals/other/how-to-kill-a-process-on-linux.md).

## How to check it worked

After a kill or priority change, the process should vanish from the list or show the new `NI` value. To confirm from the command line:

```bash theme={null}
ps -o pid,ni,stat,cmd -p 30043
```

## Frequently asked questions

### What is the difference between top and htop?

`top` is installed on every Linux server. htop adds colour meters, scrolling, mouse support, a tree view and kill or renice without typing a PID. Both read the same kernel data.

### Why does htop show memory almost full?

Check the **used** part of the bar (`F1` shows its colour), not the total. Linux uses spare RAM as cache and frees it on demand. `free -h` shows the real headroom in the `available` column. See [check memory usage](https://help.freakhosting.com/portals/other/how-to-check-memory-usage-on-linux.md).

### Where does htop save my settings?

In `~/.config/htop/htoprc`. Change settings with `F2` (Setup) rather than editing the file, because htop overwrites it on exit.

### Why is a process stuck in state D?

`D` means it is waiting for disk or network I/O and can't be killed until that finishes. Check the disk with [iostat and iotop](https://help.freakhosting.com/portals/other/how-to-check-disk-io-performance-on-linux.md).

### Does htop slow my server down?

Very little. If you leave it open for a long time, raise the refresh delay with `htop -d 30` (3 seconds).

## Related guides

> [card] [VPS and dedicated server guides](https://help.freakhosting.com/portals/other/vps-and-dedicated-server-guides.md)
>
> Every server guide in one place.

> [card] [Find what is using CPU](https://help.freakhosting.com/portals/other/how-to-find-what-is-using-cpu-on-linux.md)
>
> Track down a busy process.

> [card] [Check memory usage](https://help.freakhosting.com/portals/other/how-to-check-memory-usage-on-linux.md)
>
> free, available memory and swap.

> [card] [What is load average?](https://help.freakhosting.com/portals/other/what-is-load-average-on-linux.md)
>
> Read the three numbers.

> [card] [Kill a process](https://help.freakhosting.com/portals/other/how-to-kill-a-process-on-linux.md)
>
> kill, pkill and killall.

> [card] [VPS Panel resource graphs](https://help.freakhosting.com/portals/vps-panel/how-to-monitor-vps-resource-usage.md)
>
> CPU, memory and network history.

***

> [!NOTE]
>
> **Checked against the [htop manual](https://htop.dev/) and the [Fedora EPEL package list](https://packages.fedoraproject.org/pkgs/htop/htop/)** on 4 November 2026; commands tested on Ubuntu 24.04 LTS with htop 3.3.0. Commands can differ on other distributions or releases.

> [!NOTE]
>
> ### Need Extra Help?
>
> If you encounter any issues, our support team is ready to assist:
>
> * **Live Chat:** Quick assistance via our website.
> * **Support Ticket:** [Open a Ticket](https://freakhosting.com/clientarea/submitticket.php)
> * **Discord:** [Join our Community](https://discord.gg/freakhosting)
> * **Email:** [support@freakhosting.com](mailto:support@freakhosting.com)

> [!TIP]
>
> ### Save on Your Hosting
>
> Ready to upgrade your hosting? Use code **KB20** at checkout for **20% off** your first order!

***

**Last Updated:** November 2026


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.