Index Magento 2 using command line or SSH

Magento 2 is the latest hot topic in the ecommerce market and given their new architecture, it’s very easy to configure it using command line or SSH.

Follow these steps to reindex Magento 2 using the command line:

  1. Login to SSH/Command line
  2. Go to your Magento root directory
  3. Once in root, type cd bin
  4. In Bin, to reindex all configurations type magento indexer:reindex and hit enter. Magento 2 will start reindexing the system. Screenshot below:

    Re-index Magento 2 using command line

That’s all. You have just reindexed your magento store in one go.
Note: If you get ‘magento: command not found’, then use php keyword to run the indexing. 

Other commands to index individual sections: 

magento indexer:reindex customer_grid Customer
magento indexer:reindex catalog_category_product
magento indexer:reindex catalog_product_category
magento indexer:reindex catalog_product_price
magento indexer:reindex catalog_product_attribute
magento indexer:reindex cataloginventory_stock
magento indexer:reindex catalogsearch_fulltext
magento indexer:reindex catalogrule_rule
magento indexer:reindex catalogrule_product


Leave a Reply

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