How to Find the Total RAM (Memory) Available on Your Ubuntu Server

Whether you are setting up a new virtual private server (VPS), troubleshooting application crashes caused by out-of-memory (OOM) errors, or deciding if you need to upgrade your hardware, knowing exactly how much Random Access Memory (RAM) is installed on your machine is essential.

Unlike desktop operating systems with visual system monitors, checking memory on an Ubuntu server is typically done through the command line. Linux provides several built-in utilities that give you instant, accurate readings of your total, used, and available RAM.

This guide explains how to check the total memory on your Ubuntu system using two different terminal commands.

Method 1: Using the free Command

The free command is the fastest and most common way to check memory statistics in Linux. It reads the system’s memory files and outputs a clean table.

  1. Open your Ubuntu terminal or SSH into your server.
  2. Type the following command:
    free -h
  3. Press Enter.

Note: The -h flag stands for “human-readable,” which forces the command to display the output in Megabytes (M) or Gigabytes (G) rather than a long string of bytes.

Look at the very first row labeled Mem:. The first column is total. This number (e.g., 15G or 7.8G) represents the total amount of physical RAM available to the operating system.

You will also see used (how much is currently occupied by applications) and available (how much memory is free to start new applications without swapping).

Method 2: Reading /proc/meminfo

If you want a much deeper, more technical breakdown of exactly how your kernel is managing memory, you can read the raw system file directly.

  1. In the terminal, type the following command:
    cat /proc/meminfo
  2. Press Enter.

This will print a long list of memory statistics. The very first line, labeled MemTotal, gives you the total installed RAM in kilobytes (kB). While less visually appealing than the free command, this method is excellent for advanced bash scripting because it requires no external binary execution.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.