Sever memory exhausted while run content deploy command and sever memory can't be increase then how to run content deploy command?


4 Answers 4


Before posting a question on Stack Exchange, please have a little look around first, you'll often find the question has already been asked/answered. Maybe just asked in a slightly different way.

See the answer from this post: Fatal error "Allowed memory size" while run setup:static-content:deploy

For clarity, i think what you're looking for is (taken from post mentioned above) you can set the memory limit inline whilst running the static content deploy command:

php -dmemory_limit=6G bin/magento setup:static-content:deploy

Hope this helps.

  • Thanks for the feedback! Votes cast by those with less than 15 reputation are recorded, but do not change the publicly displayed post score. By this reason i can't do upvote.
    – Krishnam
    Commented Feb 5, 2018 at 7:21

Please try below command

php bin/magento  c:c

php bin/magento  setup:upgrade

php -d memory_limit=5G bin/magento setup:static-content:deploy

php -d memory_limit=5G bin/magento setup:di:compile

Hope it works!


Use below command to set server limit just add below code in any of the command if you have any server memory limit error.


like below command check.

php -dmemory_limit=10g bin/magento setup:static-content:deploy

Deploy only themes you need, example:

php bin/magento setup:static-content:deploy --theme Magento/blank --theme Magento/luma

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.