
If you are working with Magento 2 CMS, you must be familiar with these commands. To make development easier and more handy to run indexer, flush command, running cron etc Magento introduces these commands.
To find out all commands in a single place you can refer to this post. Below is the list of most important SSH / CLI commands for Magento 2. You need to have SSH access to your server, or you can use the command line for local access.
AVAILABLE SSH COMMANDS | SHORTCUTS | DESCRIPTION |
php bin/magento –version | php bin/magento -V | To display this application version |
php bin/magento –help php bin/magento help | php bin/magento -h | To display help message for command |
php bin/magento list | php bin/magento l | To list all Magento 2 commands |
ADMIN | ||
php bin/magento admin:user:create | php bin/magento a:u:c | Creates an administrator |
php bin/magento admin:user:unlock | php bin/magento a:u:u | Unlock Admin Account |
APP | ||
php bin/magento app:config:dump | php bin/magento a:c:d | Create dump of application |
php bin/magento app:config:import | php bin/magento a:c:i | Import data from shared configuration files to appropriate data storage |
php bin/magento app:config:status | php bin/magento a:c:s | Checks if config propagation requires update |
CACHE | ||
php bin/magento cache:clean | php bin/magento c:c | Cleans cache type(s) |
php bin/magento cache:disable | php bin/magento c:d | Disables cache type(s) |
php bin/magento cache:enable | php bin/magento c:e | Enables cache type(s) |
php bin/magento cache:flush | php bin/magento c:f | Flushes cache storage used by cache type(s) |
php bin/magento cache:status | php bin/magento c:s | Checks cache status |
CATALOG | ||
php bin/magento catalog:images:resize | php bin/magento c:i:r | Creates resized product images |
php bin/magento catalog:product:attributes:cleanup | php bin/magento c:p:a:c | Removes unused product attributes. |
CONFIG | ||
php bin/magento config:sensitive:set | php bin/magento c:s:s | Set sensitive configuration values |
php bin/magento config:set | php bin/magento c:set | Change system configuration |
php bin/magento config:show | php bin/magento c:show | Shows configuration value for given path. If path is not specified, all saved values will be shown |
CRON | ||
php bin/magento cron:install | php bin/magento c:install | Generates and installs crontab for current user |
php bin/magento cron:remove | php bin/magento c:remove | Removes tasks from crontab |
php bin/magento cron:run | php bin/magento c:run | Runs jobs by schedule |
CUSTOMER | ||
php bin/magento customer:hash:upgrade | php bin/magento c:h:u | Upgrade customer’s hash according to the latest algorithm |
DEPLOY | ||
php bin/magento deploy:mode:set | php bin/magento d:m:set | Set application mode. |
php bin/magento deploy:mode:show | php bin/magento d:m:show | Displays current application mode. |
DEV | ||
php bin/magento dev:di:info | php bin/magento d:d:i | Provides information on Dependency Injection configuration for the Command. |
php bin/magento dev:profiler:disable | php bin/magento d:p:d | Disable the profiler. |
php bin/magento dev:profiler:enable | php bin/magento d:p:e | Enable the profiler.php bin/magento |
php bin/magento dev:query-log:disable | php bin/magento d:q:d | Disable DB query logging |
php bin/magento dev:query-log:enable | php bin/magento d:q:e | Enable DB query logging |
php bin/magento dev:source-theme:deploy | php bin/magento d:s:d | Collects and publishes source files for theme. |
php bin/magento dev:template-hints:disable | php bin/magento d:t:d | Disable frontend template hints. A cache flush might be required. |
php bin/magento dev:template-hints:enable | php bin/magento d:t:e | Enable frontend template hints. A cache flush might be required. |
php bin/magento dev:tests:run | php bin/magento d:t:r | Runs tests |
php bin/magento dev:urn-catalog:generate | php bin/magento d:u:g | Generates the catalog of URNs to *.xsd mappings for the IDE to highlight xml. |
php bin/magento dev:xml:convert | php bin/magento d:x:c | Converts XML file using XSL style sheets |
DOTDIGITAL | ||
php bin/magento dotdigital:migrate | php bin/magento dot:m | Migrate data into email_ tables to sync with Engagement Cloud |
php bin/magento dotdigital:sync | php bin/magento dot:s | Run syncs to populate email_ tables before importing to Engagement Cloud |
DOWNLOADABLE | ||
php bin/magento downloadable:domains:add | php bin/magento d:d:a | Add domains to the downloadable domains whitelist |
php bin/magento downloadable:domains:remove | php bin/magento d:d:r | Remove domains from the downloadable domains whitelist |
php bin/magento downloadable:domains:show | php bin/magento d:d:s | Display downloadable domains whitelist |
ENCRYPTION | ||
php bin/magento encryption:payment-data:update | php bin/magento e:p:u | Re-encrypts encrypted credit card data with latest encryption cipher. |
I18N | ||
php bin/magento i18n:collect-phrases | Discovers phrases in the codebase | |
php bin/magento i18n:pack | Saves language package | |
php bin/magento i18n:uninstall | Uninstalls language packages | |
INDEXER | ||
php bin/magento indexer:info | Shows allowed Indexers | |
php bin/magento indexer:reindex | Reindexes Data | |
php bin/magento indexer:reset | Resets indexer status to invalid | |
php bin/magento indexer:set-dimensions-mode | Set Indexer Dimensions Mode | |
php bin/magento indexer:set-mode | Sets index mode type | |
php bin/magento indexer:show-dimensions-mode | Shows Indexer Dimension Mode | |
php bin/magento indexer:show-mode | Shows Index Mode | |
php bin/magento indexer:status | Shows status of Indexer | |
INFO | ||
php bin/magento info:adminuri | php bin/magento info:a | Displays the Magento Admin URI |
php bin/magento info:backups:list | php bin/magento info:b:l | Prints list of available backup files |
php bin/magento info:currency:list | php bin/magento info:c:l | Displays the list of available currencies |
php bin/magento info:dependencies:show-framework | Shows number of dependencies on Magento framework | |
php bin/magento info:dependencies:show-modules | Shows number of dependencies between modules | |
php bin/magento info:dependencies:show-modules-circular | Shows number of circular dependencies between modules | |
php bin/magento info:language:list | php bin/magento info:l:l | Displays the list of available language locales |
php bin/magento info:timezone:list | php bin/magento info:t:l | Displays the list of available timezones |
INVENTORY | ||
php bin/magento inventory:reservation:create-compensations | php bin/magento i:r:c | Create reservations by provided compensation arguments |
php bin/magento inventory:reservation:list-inconsistencies | php bin/magento i:r:l | Show all orders and products with salable quantity inconsistencies |
INVENTORY-GEONAMES | ||
php bin/magento inventory-geonames:import | php bin/magento i:import | Download and import geo names for source selection algorithm |
MAINTENANCE | ||
php bin/magento maintenance:allow-ips | php bin/magento main:a | Sets maintenance mode exempt IPs |
php bin/magento maintenance:disable | php bin/magento main:d | Disables maintenance mode |
php bin/magento maintenance:enable | php bin/magento main:e | Enables maintenance mode |
php bin/magento maintenance:status | php bin/magento main:u | Displays maintenance mode status |
MODULE | ||
php bin/magento module:config:status | php bin/magento mo:c:s | Checks the modules configuration in the ‘app/etc/config.php’ file and reports if they are up to date or not |
php bin/magento module:disable | php bin/magento mo:d | Disables specified modules |
php bin/magento module:enable | php bin/magento mo:e | Enables specified modules |
php bin/magento module:status | php bin/magento mo:s | Displays status of modules |
php bin/magento module:uninstall | php bin/magento mo:u | Uninstalls modules installed by composer |
MSP | ||
php bin/magento msp:security:recaptcha:disable | php bin/magento m:s:r:d | Disable backend reCaptcha |
php bin/magento msp:security:tfa:disable | php bin/magento m:s:t:d | Globally disable two factor auth |
php bin/magento msp:security:tfa:providers | php bin/magento m:s:t:p | List all available providers |
php bin/magento msp:security:tfa:reset | php bin/magento m:s:t:r | Reset configuration for one user |
NEWRELIC | ||
php bin/magento newrelic:create:deploy-marker | php bin/magento n:c:d | Check the deploy queue for entries and create an appropriate deploy marker. |
QUEUE | ||
php bin/magento queue:consumers:list | php bin/magento q:c:l | List of MessageQueue consumers |
php bin/magento queue:consumers:start | php bin/magento q:c:s | Start MessageQueue consumer |
SAMPLEDATA | ||
php bin/magento sampledata:deploy | php bin/magento s:deploy | Deploy sample data modules for composer-based Magento installations |
php bin/magento sampledata:remove | php bin/magento s:remove | Remove all sample data packages from composer.json |
php bin/magento sampledata:reset | php bin/magento s:reset | Reset all sample data modules for re-installation |
SETUP | ||
php bin/magento setup:backup | php bin/magento s:b | Takes backup of Magento Application code base, media and database |
php bin/magento setup:config:set | php bin/magento s:c:s | Creates or modifies the deployment configuration |
php bin/magento setup:cron:run | php bin/magento s:c:r | Runs cron job scheduled for setup application |
php bin/magento setup:db-data:upgrade | Installs and upgrades data in the DB | |
php bin/magento setup:db-declaration:generate-patch | Generate patch and put it in specific folder. | |
php bin/magento setup:db-declaration:generate-whitelist | Generate whitelist of tables and columns that are allowed to be edited by declaration installer | |
php bin/magento setup:db-schema:upgrade | Installs and upgrades the DB schema | |
php bin/magento setup:db:status | php bin/magento s:d:s | Checks if DB schema or data requires upgrade |
php bin/magento setup:di:compile | php bin/magento s:d:i | Generates DI configuration and all missing classes that can be auto-generated |
php bin/magento setup:install | php bin/magento s:i | Installs the Magento application |
php bin/magento setup:performance:generate-fixtures | php bin/magento s:p:g | Generates fixtures |
php bin/magento setup:rollback | php bin/magento s:r | Rolls back Magento Application codebase, media and database |
php bin/magento setup:static-content:deploy | php bin/magento s:s:d | Deploys static view files |
php bin/magento setup:store-config:set | php bin/magento s:s:s | Installs the store configuration. Deprecated since 2.2.0. Use config:set instead |
php bin/magento setup:uninstall | php bin/magento s:un | Uninstalls the Magento application |
php bin/magento setup:upgrade | php bin/magento s:up | Upgrades the Magento application, DB data, and schema |
STORE | ||
php bin/magento store:list | php bin/magento s:l | Displays the list of stores |
php bin/magento store:website:list | php bin/magento s:w:l | Displays the list of websites |
THEME | ||
php bin/magento theme:uninstall | php bin/magento t:u | Uninstalls theme |
VARNISH | ||
php bin/magento varnish:vcl:generate | php bin/magento v:v:g | Generates Varnish VCL and echos it to the command line |
YOTPO | ||
php bin/magento yotpo:reset | php bin/magento y:r | Reset Yotpo sync flags &/or configurations |
php bin/magento yotpo:sync | php bin/magento y:s | Sync Yotpo manually (reviews module) |
php bin/magento yotpo:update-metadata | php bin/magento y:u | Manually send platform metadata to Yotpo |
You can follow officila Magentoi document here
I hope this post will save your time during development as moSt of all required commands posted here based on Magento 2.3.4. Please let me know if you find out any missed command. Happy to update this!!