Ghost install fails with memory availability, but there's plenty

I’m following the Ubuntu install instructions (How to install & setup Ghost on Ubuntu 16.04, 18.04, 20.04 or 22.04) on a Ubuntu 16.04 VPS under OpenVZ with 2 GB RAM. When I get to the step of installing Ghost with ghost-cli, it fails, saying that I have inadequate available memory:

thomas@bnode:/var/www/ghost$ ghost install
✔ Checking system Node.js version
✔ Checking logged in user
✔ Checking current folder permissions
✔ Checking operating system compatibility
✔ Checking for a MySQL installation
✖ Checking memory availability
One or more errors occurred.

1) SystemError

Message: You are recommended to have at least 150 MB of memory available 
for smooth operation. It looks like you have ~77 MB available.

Debug Information:
    OS: Ubuntu, v16.04
    Node Version: v10.16.3
    Ghost-CLI Version: 1.11.0
    Environment: production
    Command: 'ghost install'

However, I have plenty of memory available, but it seems like ghost-cli isn’t considering memory currently in buffers/cache as available to it:

$ free
              total        used        free      shared  buff/cache   available
Mem:        2097152       38000      118788       11940     1940364     1929300
Swap:       2097152      115180     1981972

How can I get ghost-cli to recognize that there is oodles of available memory, not just what’s “free” and fully unused?

1 Like

You can skip the check with --no-check-mem.

The code lives here if you’d like to propose an improvement to how memory is determined:

3 Likes