How to Set System Configuration Value Using CLI Command in Magento 2

Magento 2 CMS provides the powerful command-line interface tool that allows the developers to use default commands that perform tasks including installation, modules, indexes management, database backups-updates, compiling LESS, etc.

Moreover, it also provides an excellent feature that allows the developer to set system configuration value using CLI command in Magento 2! You can set Magento 2 default configuration option value as well as third-party extension configuration value from the CLI command.

To do so, you’ll require the value of:

  • The configuration path
  • The scope code
  • Log in to your account using SSH.

The scope code is needed to set a configuration value for a particular scope, and one can find the configuration path from the ‘core_config_data’ table of the database.

To make this explanation more specific, let’s consider an example.

For instance, the admin panel of Magento 2 is not working or opening for any reason. Somehow you have to change the value of the system configuration. In that case, you have to find out a way that can change or set a system configuration value without opening the admin panel!

For such a scenario, use the below method and validate an appropriate value in the CLI command.

Method to Set System Configuration Value Using CLI Command in Magento 2

Pass CLI commands:



Set Website Wise System Configuration Value: 

Set Store Wise System Configuration Value: 

That’s it!

Any doubts about this solution can be mentioned in the Comments section below.

I’d be happy to help.

Also, do share the post with Magento Community via social media.

Thank you.

(based on 1 Reviews)
How to Set System Configuration Value Using CLI Command in Magento 2Author Magento Badge

Chandresh Chauhan

He has been with Meetanshi for more than three years now as a certified Magento developer. A silent guy whom you can always find solving clients' issues, is an avid reader too.

Leave a Reply

Your email address will not be published.