Check Server Memory, Disk, and CPU Configuration in Ubuntu

The exact commands to check RAM, disk space, and CPU specs on an Ubuntu server — and which one to reach for when something's actually running slow.

By DevStudio Online Team · Published September 3, 2026

Before you can diagnose "the server feels slow," you need to know what it actually has to work with, and what's using it right now. Two different questions, two different sets of commands.

What does this server have? (static specs)

free -h              # RAM: total, used, free, available
df -h                # disk space per mounted volume
lscpu                # CPU model, core count, architecture
nproc                # just the core count, for scripting

free -h's most useful column is available, not free — Linux aggressively uses "free" RAM for disk caching, so free alone often looks alarmingly low even on a perfectly healthy server. available accounts for cache that can be reclaimed instantly if an application needs it, and is the number that actually matters.

free -h
#               total   used   free  shared  buff/cache   available
# Mem:           7.8G   2.1G   1.2G   180M        4.5G        5.4G

That server has 5.4 GB genuinely available, not 1.2 GB — most of the rest is reclaimable cache.

What's using it right now? (live usage)

top          # built-in, always available, updates every few seconds
htop         # nicer interface, needs: sudo apt install htop

htop is worth installing on any server you'll actually work on — colored bars per core, sortable columns, and you can kill a process directly from the interface instead of looking up its PID separately.

Disk usage per directory, not just per volume

df -h tells you a volume is 90% full; it doesn't tell you what is filling it. For that:

du -sh /var/log/*     # size of each item inside /var/log
du -sh /* 2>/dev/null | sort -rh | head -10   # biggest top-level directories on the server

sort -rh sorts human-readable sizes (like 4.2G, 800M) correctly — a plain sort would put 800M after 4.2G alphabetically, which is wrong.

Putting it together: a quick health check

echo "--- Memory ---"; free -h
echo "--- Disk ---";    df -h /
echo "--- Load ---";    uptime

uptime's three numbers are the 1, 5, and 15-minute load averages — as a rule of thumb, a load average consistently above your core count (nproc) means the CPU is the bottleneck, not memory or disk.

Related tool

SSH Manager — check your server from the browser

More Linux guides