I am currently in the process of creating a Magallanes production environment for release deployments on a server.

However, I am unsure which commands actually need to be executed and in which order. Currently I execute the following:

  • composer install
  • copy/symlink app/etc/config.php & app/etc/env.php
  • custom command to set the correct domain in core_config_data table
  • app:config:import
  • setup:upgrade
  • deploy:mode:set production
  • setup:static-content:deploy …

Is there anything I am missing or should anything be executed in another order for a clean deployment?

1 Answer 1


You just have to execute this : php bin/magento deploy:mode:set production, by doing this Magento clear the contents of following directories:


I let you see the Magento mode DevDocs.

  • This is not enough. If I only use deploy:mode:set production during the magephp deployment procedure, I get the following error in the front end: The configuration file has changed. Run app:config:import or setup:upgrade command to synchronize configuration.
    – fritzmg
    Sep 14, 2018 at 15:43
  • According to the Magento dev doc, you don't need that, try to execute that command so php bin/magento setup:upgrade
    – PЯINCƎ
    Sep 14, 2018 at 15:46
  • But that is my question ;). See above: I am asking which commands I have to execute in which order. So what should it be now?
    – fritzmg
    Sep 14, 2018 at 15:47
  • the is no problem if you execute bin/magento setup:upgrade before or after the deploy command so 1. php bin/magento deploy:mode:set production 2. php bin/magento setup:upgrade also if you want php bin/magento setup:static-content:deploy
    – PЯINCƎ
    Sep 14, 2018 at 15:51
  • setup:static-content:deploy is not necessary, this is done by deploy:mode:set production. I have the following order which seems to work now: pastebin.com/3QyVWzX1 However I still wonder is this is the correct way to do. I think the fact that I have to manually change the website domain in the database makes the app:config:import necessary.
    – fritzmg
    Sep 14, 2018 at 15:53

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.