How to disable module in Magento 2

Admin

Sometime we need to disable module on our local system.

Lets take simple example of module TwoFactorAuth.

After fresh Magento installation when we try to login to Magento admin account sometimes we can see following error message.


“You Need to Configure Two Factor Authorization”.

On our local setup usually we don’t need this kind of 2FA.

So in order to resolve this issue, we can disable this module on local.

You can check all module status using following command.

First open the terminal and goto your project root directory.

$ php bin/magento module:status

There is no any disable module found at the moment.

Lets disable module “Magento_TwoFactorAuth”.

$ php bin/magento module:disable Magento_TwoFactorAuth

Now we need to disable “Magento_AdminAdobeImsTwoFactorAuth” first. Then only it will allow us to disable “Magento_TwoFactorAuth”.

Lets try it once –

$ php bin/magento module:disable Magento_AdminAdobeImsTwoFactorAuth

It will show following screen –

Now we can disable “Magento_TwoFactorAuth”

$ php bin/magento module:disable Magento_TwoFactorAuth

Now run following command to flush the cache and upgrade the db.

$ php bin/magento cache:flush && php bin/magento setup:upgrade 

Leave a Reply

Your email address will not be published. Required fields are marked *