Magento 2 – how to enable or disable modules via SSH

While browsing through StackOverflow these past few days, I’ve noticed that people seem to be having issues with managing, specifically enabling or disabling, modules in Magento 2. Some issues stem from a buggy admin interface, others just from lacking guides on the subject matter. So here’s just what I recommend keeping on hand when dealing with modules via SSH.

Upload module files to server via SFTP (or any other method of your choice)

Assuming you haven’t done so, this should obviously be the first step. Most of the time it’s just a matter of extracting the package that you’ve downloaded into the root directory of your site.

Connect to server via SSH and cd into your Magento root directory

This should be pretty self-explanatory.

Common commands

Use this to get a list of currently installed modules. Active and disabled modules will be separated. This will also give you the module name that you’ll need in the next command.

To enable or disable a module use the following command:

Update your database with:

And lastly perform:

Conclusion

That’s it! If you have any questions please let me know in the comments bellow. Happy coding 🙂