Cannot allocate memory Error


So I am following on with the youtube tutorial:

However when I input the command:

composer create-project --repository-url= magento/project-community-edition .

I Get the error:

mmap() failed: [12] Cannot allocate memory
mmap() failed: [12] Cannot allocate memory
PHP Fatal error:  Out of memory (allocated 645931008) (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleSetGenerator.php on line 129

I have tried updating the /etc/.../php.ini file but using -1 (infinity) and 2G does not have any effect.

Any suggestions on this error?


This is because your server spec is not enough to install M2 using composer.

Alternatively, you can download M2.3.2 from here. (You need to create account first.)

Kind regards,


1 Like

Hello @YoKoNo and welcome.

Magento requires a minimum of 2GB to run without these types of errors. Assuming your server has 2GB available, you still need to update the .htaccess file in the Magento root directory. The default file is set to 756MB (no idea why).

In this tutorial (How to install Magento 2.3 and build a web server ), look for the bit labelled “Update memory_limit” to utilise the available memory on the server.

Thank you both for your responses @thomas @digitalstartup.

I am using digital ocean small droplet so will upgrade that and see if it works.