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.

  • Beginner
  • Linux VPS
  • 5 min read

By RunRacks Team · Published

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 Dashboard, 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:

Terminal
nproc
Text
4

For detail, use lscpu:

Terminal
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:
Terminal
lscpu | grep -o -w -E 'aes|avx2' | sort -u

Memory (RAM)

free -h shows memory in readable units:

Terminal
free -h
Text
               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.

Disk space

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

Terminal
df -h
Text
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:

Terminal
df -h -x tmpfs -x devtmpfs

Disks and partitions

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

Terminal
lsblk
Text
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:

Terminal
lsblk -f

Virtualization type

systemd-detect-virt prints the virtualization technology:

Terminal
systemd-detect-virt
Text
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:

Terminal
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 RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.

Getting started

Edit files with nano: a beginner's guide

Open, edit, search and save files with the nano text editor on a Linux server, including cutting and pasting lines, showing line numbers and safely editing system config files with sudo.

  • Beginner
  • Linux VPS
  • 5 min read

Getting started

Your first hour with a new RunRacks server

A step-by-step roadmap for the first hour after your RunRacks server is delivered, from finding your login details to changing the password, updating the OS and picking your next guides.

  • Beginner
  • All
  • 5 min read

Getting started

How to choose a server location

Pick a data center location based on where your users, broker or team are, confirm it with ping tests, and weigh the legal and latency points that come with each choice.

  • Beginner
  • All
  • 4 min read