When I am creating new module I ran following commands for full deployment:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush

But it took so much time, 30 minutes approx

How can I make it more faster?

  • what is your server configuration and magento version?
    – Amit Bera
    Commented Feb 9, 2019 at 16:42
  • Magento 2.2.7, I am using xamp, its on local environment
    – Atif Ameer
    Commented Feb 9, 2019 at 16:44
  • On which mode you are working right now? Please check and do let me know magento deploy:mode:show Commented Feb 10, 2019 at 13:04
  • its on default mode
    – Atif Ameer
    Commented Feb 10, 2019 at 16:08
  • Did you resolve your issue? Commented Feb 11, 2019 at 12:48

1 Answer 1


The most time taken process in your listed commands are:

  1. Upgrade: php bin/magento setup:upgrade
  2. Di Compile: php bin/magento setup:di:compile

By doing 2 basic tasks you will speedup your these commands.

First: Change mode to production (if it is default or development)

php bin/magento deploy:mode:set production --skip-compilation

Note: If your project is at development phase, then you need development mode for error reporting and other stuff

Second: integrate Eleanorsoft module in your project. Download Eleanorsoft

  • Copy Eleanorsoft folder to app/code/.
  • Run setup:upgrade.
  • Run setup:di:compile.
  • After compilation, you should see a folder var/di_cache/ with 4 (or more) files. This is the actual cache. From now your compilation process will use these cached lists instead of scanning the whole filesystem.

I personally integrated this module just now and noticed, di compile tool 19 mins at first, but after integrating this module it completed in just 8 mins

Reference of eleanorsoft: https://www.eleanorsoft.com/speed-up-magento-2-di-compilation-setupdicompile/

  • Thanks for the detailed answer, I will try this solution. Will let you know if it worked for me
    – Atif Ameer
    Commented Feb 10, 2019 at 16:13
  • It worked. Much optimized now
    – Atif Ameer
    Commented Feb 11, 2019 at 14:44

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.