Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Reindex Magento Data Using SSH

This guide shows you how to rebuild Magento's index tables from the command line so your store shows up-to-date products and prices.

How-To Guides2 min read7 steps

What is indexing?

Magento is software for online shops. A store can hold thousands of products. To show them fast, Magento keeps neat lookup lists called indexes. They work like the index at the back of a book. When you change a price or add a product, the index must be updated. If it is not, the shop may show old prices or miss new items. Reindexing rebuilds those lists.

SSH is a safe way to type commands on your server. You need SSH access on your plan. Ask Hostvento support if you are not sure it is on.

Steps

  1. Connect to your server:
ssh username@your-server-ip
  1. Go to your Magento folder. Use your own path:
cd /home/username/public_html
  1. See the state of all indexes:
php bin/magento indexer:status

Each line shows an index name and whether it is valid or needs a reindex.

  1. Rebuild all indexes:
php bin/magento indexer:reindex

This can take several minutes on a big store.

  1. To rebuild only one, give its name:
php bin/magento indexer:reindex catalog_product_price
  1. Clear the cache so the new data shows:
php bin/magento cache:flush
  1. Run indexer:status again and check that all say Ready.

See the list of index names

php bin/magento indexer:info

This lists every index you can pick.

Update on save or on schedule

Magento can update indexes two ways. Update on Save does it at once when you save a change. Update by Schedule does it in the background with cron (a timer on the server). You can see or set it:

php bin/magento indexer:show-mode
php bin/magento indexer:set-mode schedule

Scheduled mode is better for large stores. It needs cron to be working.

Common problems

  • Permission denied: run the command as the same user that owns the Magento files.
  • Memory error: run with more memory, for example php -d memory_limit=2G bin/magento indexer:reindex.
  • Index "locked": another run may be in progress. Wait and try again.
Tip: Reindex at a quiet time, because it uses server power.

Quick recap

  • Indexes keep a Magento shop fast and correct.
  • Use indexer:status to check them.
  • Use indexer:reindex to rebuild them.
  • Flush the cache afterwards.