Guide

Check CPU, memory, disk and open ports on a VPS

Last updated: 15 November 2026

When something is slow or broken, five minutes with these commands usually shows why. The commands in the grey blocks are read-only and safe to run. If you are logged in as root, leave out sudo.

Fast VPS from $7.99 a month

See Fast VPS plansHow ordering works

Memory and CPU

uptime
free -h
top

uptime shows the load averages for 1, 5 and 15 minutes: numbers well above your CPU core count mean the server is overloaded. free -h shows memory and swap (look at the "available" column). In top, press M to sort by memory and P by CPU, and q to quit. If memory is the problem, see adding swap.

Disk

df -h
sudo du -xh --max-depth=1 / | sort -h | tail -15

df -h shows how full each disk is; a disk at 100% breaks many services. The second command lists the biggest folders on the root disk. Logs are a common cause: check /var/log and sudo journalctl --disk-usage, and trim the journal with sudo journalctl --vacuum-size=200M (this deletes old journal entries).

What is running and listening

ps aux --sort=-%mem | head
sudo ss -tulpn
systemctl --failed

ss -tulpn lists every listening port and the program behind it: anything you do not recognise on a public address deserves a look. systemctl --failed shows services that crashed.

Logs and the network

sudo journalctl -p err -b | tail -30
sudo journalctl -u ssh -n 50
ping -c 4 1.1.1.1

journalctl -p err -b shows errors since the last boot. journalctl -u ssh shows SSH logins and failed attempts on Debian and Ubuntu (on AlmaLinux and Rocky the unit is sshd). If SSH fails, use the emergency console on your service page, if it shows one.

Related

First login · Firewall · Fail2ban · Fast VPS

Questions and answers

How do I see if my VPS is out of memory?
Run free -h and look at the available column; in top, press M to sort by memory. If the server is often short, add swap or a bigger plan.

How do I find what fills the disk?
Run df -h to see which disk is full, then sudo du -xh --max-depth=1 / | sort -h | tail -15 to find the biggest folders; logs are a common cause.

How do I see which ports are open?
Run sudo ss -tulpn: it lists every listening port and the program that uses it.

How do I read the system errors?
Run sudo journalctl -p err -b to see errors since the last boot, and systemctl --failed for crashed services.

Ready to try it? Fast VPS from $7.99 a month

See Fast VPS plansHow ordering works