List of Magento 2 Commands

Magento 2 Commands List

Below is the list of most important SSH / CLI commands for Magento 2 that I have found useful. To use these commands you will need to have SSH access to your server or use the Command Line for local access.

Setup Upgrade Using Command Line

php bin/magento setup:upgrade

If you don’t want to remove pub/static files while installing/updating database then use following command.

php bin/magento setup:upgrade –keep-generated

Cache Clean Using Command Line

php bin/magento cache:clean

Cache Flush Using Command Line

php bin/magento cache:flush

Cache status Using Command Line

php bin/magento cache:status

Disable Cache Using Command Line

php bin/magento cache:disable [cache_type]

Static Content Deploy Using Command Line

php bin/magento setup:static-content:deploy

Static Content Deploy For Particular Language Using Command Line

php bin/magento setup:static-content:deploy en_US

Static Content Deploy For Magento Backend Theme Using Command Line (Working on 2.1.1 or later)

php bin/magento setup:static-content:deploy –theme=”Magento/backend”

Static Content Deploy For Specific Themes Using Command Line (Working on 2.1.1 or later)

php bin/magento setup:static-content:deploy –theme Magento/luma –theme Magento/second_theme

Exclude Themes on Static Content Deploy and does not minify HTML files Using Command Line (Working on 2.1.1 or later)

php bin/magento setup:static-content:deploy en_US –exclude-theme Magento/luma –no-html-minify

Reindexing Using Command Line

php bin/magento indexer:reindex

View the list of indexers Using Command Line

php bin/magento indexer:info

View indexer status Using Command Line

php bin/magento indexer:status

Show the mode of all indexers Using Command Line

php bin/magento indexer:show-mode

Single-tenant Compiler Using Command Line

php bin/magentosetup:di:compile

Change To Production Mode Using Command Line

php bin/magentodeploy:mode:set production

Change To Developer Mode Using Command Line

php bin/magentodeploy:mode:setdeveloper

Check Current Mode Using Command Line

php bin/magento deploy:mode:show

Uninstall Module Using Command Line

php bin/magento module:uninstall Namespace_Module

Disable module Using Command Line

php bin/magento module:disable Namespace_Module

Enable module Using Command Line

php bin/magentomodule:enable Namespace_Module

All modules Status Using Command Line

php bin/magento module:status

(Visited 49 times, 1 visits today)