theme: ricetheme
New palette
New palette

Install htop on Linux: A Complete Step-by-Step Guide

Install htop on your Linux distro, verify it runs, then use its columns, colors, and shortcuts to spot resource-hungry processes and act quickly.

Flat illustration of a terminal installing htop, showing neon green CPU bars and process stats on a dark navy background.

tl;dr the short answer

htop is an interactive process viewer that displays running programs and their CPU and memory use in a live, scannable terminal screen. Install it with your system’s package manager, then use its sorting, search, filters, and tree view to find processes; its built-in controls can also stop a process or adjust its priority. It works locally or over SSH, making it easier to diagnose slowdowns and manage what’s running without guessing.

Picture a terminal slowing to a crawl while a build hangs and you have no idea which process is to blame. That’s where htop shines.

It’s an interactive process viewer that shows what’s running, how much processor (CPU) time and memory each process uses, and lets you act on it right from the same screen.

Here, we’ll install it on the major Linux distros, verify it runs, and fix the usual hiccups. We’ll also show you how to read its columns and colors, then theme it to match your terminal palette.

Why Install Htop and What It Does

Ever run top and wish it showed you more at a glance? That’s the gap htop fills.

How htop differs from the top command

htop is an interactive process viewer: a live list of what your machine is running, with real-time system metrics that keep updating on screen. It’s an enhanced alternative to top, the classic command it improves on.

The name is simply top with an h in front, a nod to the tool it upgrades.

Is htop just a fancier top? In a sense, yes: it covers the same ground, but with a layout you can scan in seconds rather than decode.

Main features you get with htop

A few features do most of the heavy lifting:

  • Color-coded display: busy processes stand out at a glance.
  • Vertical and horizontal scrolling: move down long lists, then sideways to read full command lines.
  • Tree view: nests each child process under the program that started it.
  • Built-in kill and renice: stop a process or change its priority (renice) without leaving the screen.
  • Customizable view: pick the columns and meters you want.
  • Per-CPU usage meters: one bar per processor core, so one pinned core can’t hide in an average.

Picture a student on a ten-year-old ThinkPad whose fan roars during every build. Their per-CPU meters show one core pinned, so they find the runaway process and stop it. Quiet fan, happy student.

Is there something better than htop? Better depends on what you’re after. For a different look or focus, btop, glances, and bpytop are worth a look.

What You Need Before You Start

Before you install htop, an interactive process viewer with a live, colorful list of what your machine is running, make sure your setup is ready. A quick check now prevents a half-finished install.

Access and setup you need

You’ll need a root or sudo user. Root is the all-powerful admin account, while sudo lets a regular user run admin commands on request. Use sudo for one command rather than working as root all day.

A fresh OS install is recommended. Picture a self-hoster who spins up a new virtual private server (VPS), a rented slice of a bigger computer, and wonders why the processor (CPU) spiked overnight.

On a clean system, the htop list holds only what they put there, so the culprit is easy to spot.

You also need terminal access: a terminal app on your desktop, or an SSH (Secure Shell, a way to log into a remote machine) session.

Finally, you’ll need an internet connection, since the install pulls packages from your distro’s online repositories. Nothing fancy is required.

Dark terminal interface showing an SSH connection, a VPS server icon, a process list with one high-CPU spike, and four action cards.

What we assume you already know

We assume you have basic Linux and shell knowledge:

  • moving between folders
  • running a command
  • reading its output

If cd and ls look familiar, you’re in good shape.

You should also own the machine or have full control of it, whether that’s a VPS like the one above or a server in your home. On someone else’s box, ask them before changing anything.

And if you’re a regular user without sudo, add it before you continue. The steps vary by distro, so check your distro’s documentation.

Install Htop on Your Linux Distro

Ever had your laptop crawl and wondered which process is to blame? Htop shows you that on one screen, and it’s usually one command away. Find your distro family below and copy the matching line.

Installing on Debian, Ubuntu and Mint

On Debian, Ubuntu, and Linux Mint, update your package lists first, then install:

sudo apt update
sudo apt install htop

Say you just reinstalled Linux Mint and your fans won’t quiet down. Once htop is in, you can spot the runaway process in seconds.

Installing on Fedora and Red Hat systems

Fedora users should run sudo dnf update first, then:

sudo dnf install htop

Red Hat Enterprise Linux and its rebuilds need the EPEL (Extra Packages for Enterprise Linux) repository enabled before htop appears. Rocky Linux follows the same steps.

A homelabber with a fresh Rocky server can check its load over SSH (Secure Shell) the moment htop is in.

Getting htop on Arch, openSUSE and macOS

  • Arch: sudo pacman -S htop. It’s in the official repositories, so you don’t need the AUR (Arch User Repository).
  • Manjaro: Manjaro is an Arch derivative, so the same pacman command works.
  • openSUSE: sudo zypper install htop
  • macOS: If you have Homebrew (the package manager for macOS), run brew install htop.

Refresh your packages before installing

Your package manager keeps a local list of what’s available, and that list can go stale. Refresh it so you’re installing from current information.

  • Debian, Ubuntu, Mint: sudo apt update
  • Fedora and Red Hat systems: sudo dnf update, or sudo dnf clean all to clear cached data.
  • Arch and Manjaro: sudo pacman -Syu refreshes the list and upgrades installed packages, so expect a bigger download.

Refreshing is about knowing what’s available, while upgrading is about changing what’s installed. Refresh first. Then install.

Check the install and run htop

Confirm the install with these checks:

  1. htop --version prints the version you installed.
  2. htop --help lists the options you can use.
  3. dnf info htop shows package details on Fedora and Red Hat systems.
  4. Run htop in your terminal, then press q to quit.

Command not found? That means your shell can’t locate htop, so the install likely didn’t finish. Scroll up for errors, rerun the install line for your distro, and open a fresh terminal.

If your repos don’t carry htop, look for it as a Snap or Flatpak package (self-contained app bundles), or build it from source using the htop project’s instructions.

Getting Around Htop and Its Shortcuts

Htop looks busy at first, but a handful of keys covers most of it.

What’s on the htop screen

The screen has three parts:

  • Header: CPU bars plus memory and swap meters, with uptime and load average (a rough gauge of how busy the system is).
  • Process list: one row per program, with its PID (process ID) and owning user.
  • Footer: the function-key shortcuts along the bottom.

Moving around, searching and filtering

Arrow keys scroll the list. Press / and type to jump to a match, then tap F3 for the next one.

Filtering is different. Search finds a process, while filtering hides everything else. Press F4 and type part of a name, or press u to pick one user. Stuck? F1 opens the help menu.

Two terminal windows show process lists: one highlights a search match with amber, the other filters results to green rows.

Managing running processes

Highlight a process and press F9 to send it a kill signal, which ends it right away, so double-check the name first. There’s no undo.

Renicing changes a process’s nice value, which sets its CPU priority. It’s about giving a process less priority, not stopping it. F8 lowers priority, while F7 raises it. F7 needs root, so run sudo htop for that.

Think of a student on a ten-year-old ThinkPad whose video call stutters while a backup runs. They press F8 on the backup, and the call gets the room it needs.

Press Space to tag several processes, then act on them together. Press s to trace system calls with strace, or l to list open files, which relies on the lsof tool.

Sort processes by CPU, memory or time

Press F6 to pick a sort column. CPU shows what’s busy now, memory shows what’s using the most, and TIME+ shows total processor time used. Press I to reverse the order.

Tree view and making htop your own

Press F5 to toggle tree view, which nests each process under the one that started it.

Press F2 for setup, where you pick columns, header meters, and your color scheme.

Matching your palette is usually automatic. htop’s default colors come from your terminal’s standard palette, so a palette swap often shows up in htop too.

A ricer who swaps palettes every few months keeps htop in step with the rest of the desktop, as long as they stick with the default scheme.

Reading the Columns and Colors

htop looks busy, but most of it comes down to a few columns and colors.

What the process columns mean

  • PID: the process ID, handy for killing or renicing.
  • USER: the owning account.
  • PR and NI: the priority and the nice value, where a lower nice value means higher priority.
  • VIRT: mapped virtual memory, often far more than the process uses.
  • RES: the resident RAM it’s actually occupying.
  • SHR: the shared part of RES.
  • CPU% and MEM%: its share of CPU time and physical memory.
  • S: the status code. R is running, S sleeping, D waiting on disk, Z zombie (finished, not yet cleaned up), T stopped.

Say you’re a self-hoster whose old ThinkPad crawls every night. You sort by MEM% and spot a backup job with a big RES and a D status. It’s waiting on the disk, not hogging the CPU.

Watch RES rather than VIRT, since the scarier number usually tells you less.

What the colors in htop mean

The bars at the top show load, and their colors show what kind.

  • CPU bars: green for normal user work, blue for niced (low-priority) work, red for kernel time, and gray for waiting on input and output.
  • Memory bar: green for used memory, blue for buffers, and yellow for cache.
  • Process list: niced processes show in blue, and kernel threads appear in brackets, like [kworker].

Those colors are themeable. Open setup with F2, pick Colors, and match your palette. Choices save to your htoprc at ~/.config/htop/htoprc (older versions used ~/.htoprc).

Version-control that file in your dotfiles repo and symlink it into place. A fresh install gets your exact look back. One git clone and you’re done.

Flat vector illustration of an htop terminal display with color-coded CPU and memory bars, alongside a dotfiles configuration card and a laptop showing the restored theme.

Practical Uses and Best Habits

Once htop is running, we’ll look at the jobs it handles best and the habits that keep your system healthy. Most of these take only a few keystrokes.

Ways to put htop to work

Here’s how to handle four common jobs:

  • Finding high CPU and memory hogs. Press F6, pick CPU% or MEM%, and the worst offender rises to the top.
  • Monitoring a specific user. Run htop -u yourname to see only that account’s processes, which is handy on a shared machine.
  • Spotting orphaned processes. These are children whose parent has already exited. Press F5 for tree view and look for stray branches that don’t belong.
  • Killing unresponsive apps. Select the process and press F9. Send SIGTERM to ask it to quit, and save SIGKILL for when you need to force a stop, since it skips any cleanup.

Keeping an eye on performance

  • Run regular resource checks. Glance at the CPU and memory bars in the header after big updates or once a week, so you catch drift before it becomes a problem.
  • Diagnose performance issues. If the load average in the header stays above your core count, work is piling up. Sort by CPU to see what’s holding things back.

Consider a student running a ten-year-old ThinkPad whose fan roars through every lecture. They open htop, sort by CPU, and spot a sync job pinning one core. Stopping it keeps the laptop cool through the rest of class. Problem solved.

Stay updated on features. htop picks up new ones over time, so skim the release notes after an update and run htop --version to confirm which build you’re on.

Common Questions and Where to Learn More

Once htop is installed, a few questions come up often: remote use, updates, and where to read more. Here’s how to handle each.

Running htop over SSH and updating it

Think of a student who runs a home server in a closet and checks it from the couch.

When the fan starts roaring, they connect with SSH (Secure Shell, a way to log into another machine over a network), run htop, and spot the runaway process in seconds. No desktop needed.

Running htop over SSH is less about learning a new tool and more about where you run it. As long as htop is on the remote machine, the controls work just as they do locally.

Update it with the package manager that handles your other software:

  1. Run your distro’s upgrade command for installed packages.
  2. Open htop again and check the version.

Repeat this on every machine you SSH into. Your laptop can be up to date while your server quietly isn’t.

For the project’s own word, head to the official htop website. If a tutorial and your system disagree, check it first, since it comes straight from the project.

For distro-specific steps, start with the install walkthroughs earlier in this guide. The official site is for confirming details, while those walkthroughs are for getting it done. Bookmark both, and the next broken install gets a quicker fix.

htop gives you a clear view of what your machine is doing, and a few minutes of setup gets you there. Once it’s installed and verified, you can check on runaway processes in seconds instead of guessing.

Keep your color scheme in step with the rest of your desktop, and it becomes a tool you actually enjoy opening.

Your terminal should look like you, and it should also tell you the truth about what’s running.

Questions

How do I install htop on Ubuntu?

On Ubuntu, refresh the package lists and install htop with `sudo apt update && sudo apt install htop`. Then run `htop` in your terminal.

How do I install htop on my Mac?

If you have Homebrew installed, run `brew install htop` in Terminal. Start it with `htop`.

How to install htop on arch linux?

On Arch Linux, run `sudo pacman -S htop`. The package is available in the official repositories, so you do not need the AUR.

Why is htop called htop?

The name is “top” with an “h” added, as a nod to htop being an enhanced alternative to the classic `top` command.

Is there something better than htop?

“Better” depends on what you need. Btop, glances, and bpytop are alternatives with different looks and focuses.

Is htop better than top?

htop is generally more interactive and easier to scan, with features such as color-coded metrics, scrolling, tree view, and built-in process controls. The classic `top` is simpler and commonly available by default, so which is better depends on your needs.