Getting started

Check your VPS CPU, RAM and disk from the command line

Confirm how many CPU cores, how much memory and how much disk space your Linux VPS has with nproc, lscpu, free, df and lsblk, and check the virtualization type.

BeginnerLinux server5 min read

After your VPS is delivered, or after you upgrade a plan, it is worth confirming the server has the CPU, memory and disk you expect. A few read-only commands tell you everything in under a minute. This guide shows them, explains how to read the output, and covers the usual reasons a number looks slightly different from your plan.

Before you start

  • SSH access to your Linux VPS. See Connect to your Linux VPS with SSH.
  • Your plan details from the service page in your VPS provider's control panel, so you can compare.
  • These commands are present on Ubuntu, Debian, AlmaLinux and Rocky Linux by default and change nothing.

CPU cores

The quickest check is nproc, which prints the number of CPU cores available:

Bash
nproc
4

For detail, use lscpu:

Bash
lscpu

The lines to read:

  • CPU(s): the total number of virtual CPUs (vCPUs). This should match your plan.
  • Model name: the processor model the host exposes.
  • Thread(s) per core, Core(s) per socket, Socket(s): how those vCPUs are presented. On a VPS this layout is set by the virtualization platform and can look odd; the total in CPU(s) is what counts.
  • Hypervisor vendor: shows the virtualization platform, for example KVM.
  • Flags: CPU features. Search it for a specific feature such as aes or avx2:
Bash
lscpu | grep -o -w -E 'aes|avx2' | sort -u

Memory (RAM)

free -h shows memory in readable units:

Bash
free -h
               total        used        free      shared  buff/cache   available
Mem:           3.8Gi       612Mi       2.4Gi       1.0Mi       1.0Gi       3.2Gi
Swap:          2.0Gi          0B       2.0Gi

How to read it:

  • total: the memory the operating system can use.
  • available: how much memory programs can still get without swapping. This is the number to watch.
  • buff/cache: memory Linux uses to cache files. It is released when programs need it, so a low free value is normal and not a problem.
  • Swap: disk space used as overflow memory. Many VPS images have none until you add it.

Note: total is always a little lower than the plan figure. The kernel reserves some memory for itself, and tools often show gibibytes (Gi, 1024-based) while plans are usually quoted in gigabytes. A 4 GB plan commonly shows around 3.7 to 3.9 Gi.

Disk space

df -h shows each mounted filesystem, its size and how full it is:

Bash
df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        79G  3.1G   72G   5% /

Look at the line mounted on /. That is your main disk. Ignore tmpfs entries; they live in memory.

To exclude temporary filesystems, use:

Bash
df -h -x tmpfs -x devtmpfs

Disks and partitions

lsblk shows the physical layout: every disk and how it is split into partitions:

Bash
lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
vda    252:0    0   80G  0 disk
├─vda1 252:1    0   79G  0 part /
└─vda2 252:2    0    1G  0 part [SWAP]

lsblk shows the size of the disk, while df shows the size of the filesystem. If the disk is larger than the filesystem, for example after a plan upgrade, the extra space is not in use yet. See Resize the disk after a VPS upgrade.

Add -f to see filesystem types and labels:

Bash
lsblk -f

Virtualization type

systemd-detect-virt prints the virtualization technology:

Bash
systemd-detect-virt
kvm

kvm means a full virtual machine with its own kernel. Container types such as lxc or openvz share the host's kernel, which limits some features such as custom kernel modules. none means bare metal.

Everything in one go

This short block prints a summary you can paste into a support ticket:

Bash
echo "CPU: $(nproc) cores"
free -h | awk '/^Mem:/ {print "RAM: " $2 " total, " $7 " available"}'
df -h / | awk 'NR==2 {print "Disk /: " $2 " size, " $4 " free"}'
echo "Virt: $(systemd-detect-virt)"

Check it works

Compare what you found with your plan:

  • nproc should equal the vCPU count.
  • free -h total should be close to the plan's RAM, allowing for the reserve described above.
  • lsblk disk size should match the plan's storage.

If a number is clearly wrong, for example half the cores or a much smaller disk, open a support ticket with the summary output.

Troubleshooting

  • RAM looks lower than the plan: a small gap is normal (kernel reserve and GiB versus GB). A gap of more than about 10 percent is worth a ticket.
  • Disk is bigger in lsblk than in df: the partition or filesystem was not grown after an upgrade. Resize it before you rely on the space.
  • free shows very little free memory: check available, not free. Cache is reclaimed automatically.
  • No swap listed: that is the default on many images. Add it if you need it with Add a swap file on Linux.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.