Articles on: Magento 2 User Guide

How to set Magento 2 Developer and Production Mode via SSH

How to Set Magento 2 Developer and Production Mode via SSH


Switching between Developer and Production mode in Magento 2 is often necessary for development, debugging, or optimizing performance in a live environment. Here’s how to manage it via SSH.



1. Connect via SSH

Use an SSH client to connect to your server. Your hosting provider will supply the SSH credentials.

👉 If you run into connection issues, make sure your IP is whitelisted.



2. Navigate to Your Magento Root Directory

Once connected, move into the root of your Magento 2 installation. Typically, this is inside the html folder.


cd mymagentostore.com/html



3. Check the Current Store Mode

Run the following command to see which mode your Magento store is currently using:


php bin/magento deploy:mode:show



4. Switch Between Modes


a. Set Magento 2 to Developer Mode

Developer Mode is useful for debugging and module development.


php bin/magento deploy:mode:set developer


b. Set Magento 2 to Production Mode

Production Mode is recommended for live sites to maximize performance.


php bin/magento deploy:mode:set production



Notes

  • On some servers, the php bin/magento command may not work directly.
  • Depending on your hosting provider, you may need to specify the PHP binary path. For example:


/usr/local/php56/bin/php-cli bin/magento deploy:mode:set developer


or


/usr/local/php70/bin/php-cli bin/magento deploy:mode:set production



✅ That’s it! You’ve successfully switched Magento 2 between Developer and Production modes using SSH.

Updated on: 18/09/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!