htop is an interactive system monitor and process viewer for Linux. It provides a real-time, color-coded display of CPU, memory, swap usage, running processes, and system load—all in a user-friendly, terminal-based interface.
This guide explains how to install and use htop on your Linux VPS.
What is htop?
Unlike the default top command, htop allows you to:
• Scroll through processes vertically and horizontally
• Kill or renice processes with a simple keypress
• Sort processes by CPU, memory usage, or other metrics
• View CPU cores and memory graphically in real time
Step 1: Connect to Your VPS via SSH
Open your terminal and connect:
ssh root@your_server_ip
Replace your_server_ip with your actual VPS IP address.
Step 2: Install htop
On Debian/Ubuntu:
apt update
apt install htop
On CentOS/AlmaLinux/RHEL:
yum install epel-release -y
yum install htop -y
Or for newer systems with dnf:
dnf install epel-release -y
dnf install htop -y
Step 3: Run htop
Once installed, simply run:
htop
This will launch the interactive system monitor.
Understanding the htop Interface
At the top, you’ll see:
• CPU usage per core
• Memory (RAM) and swap usage
• System uptime, load average, and task summary
Below that, a list of running processes with:
• PID (Process ID)
• User
• CPU % and Memory %
• Running time
• Command
Common Controls
While inside htop, you can use the following keys:
• F1 – Help
• F2 – Setup / Settings
• F3 – Search for a process
• F4 – Filter processes
• F5 – Tree view (process hierarchy)
• F6 – Sort by column (CPU, memory, etc.)
• F9 – Kill a process
• F10 – Quit htop
Use arrow keys or mouse to navigate through the interface.
Step 4: Exit htop
To exit htop, simply press:
F10
or use q.
Conclusion
htop is a powerful and easy-to-use tool for monitoring your VPS in real time. It helps identify processes consuming high CPU or memory, manage services, and maintain system performance.
If you need help with resource management or performance tuning, feel free to contact Hosteons Support.