Can we set developer to production mode on the local server?

Magento 2.x Php 7.x

  • yes you can set. – Sukumar Gorai Jul 25 at 12:41
  • Ok, I tried but class does not exist got the issue. – Masud Shaikh Jul 25 at 12:45
  • Command returned non-zero exit code: /usr/bin/php7.0 -f /var/www/html/home/outdoorkitchen/public_html/bin/magento setup:static-content:deploy en_US 2>&1 – Masud Shaikh Jul 25 at 14:07

Yes, you can change the mode from developer to production on the local server.

Please run the following command:

php bin/magento deploy:mode:set production

You can refer the Magento developer documentation here

Yes you can set production mode on local

Use below command

clear the contents of following directories:


Display the current mode

php bin/magento deploy:mode:show

Change to production mode

bin/magento deploy:mode:set production

Change to developer mode

bin/magento deploy:mode:set developer
  • @Masud Shaikh please accept this answer . it's save other developer R&D time – Shorabh Jul 26 at 4:14

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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