Reading list Switch to dark mode

    Magento Commands List

    Updated 9 April 2024

    About Magento

    Magento is a free open-source e-commerce platform that helps users to create online stores. It is the most popular content management system (CMS) used to build online stores and is compatible with the latest technologies like PHP7.

    Magento 2 is also mobile-friendly, with responsive themes and easy checkout.

    Magento command

    In Magento, several commands are used for different purposes.

    We run all these commands from the Magento root directory (The directory where Magento is installed).

    Open the Magento root directory in terminal

    You can open the Magento root directory in the terminal by simply opening the Magento root directory folder in the file explorer.

    Searching for an experienced
    Magento 2 Company ?
    Find out More
    Magento Root Directory

    Now right-click on the mouse and select the “Open in Terminal” option.

    Magento root directory

    It will open your Magento root directory in the terminal where you can execute your Magento commands.

    Magento root directory in terminal

    Here you can execute your Magento commands.

    Execute Magento command

    Magento basic commands

    • php bin/magento deploy:mode:show
    • php bin/magento setup:upgrade
    • php bin/magento setup:di:compile
    • php bin/magento setup:static-content:deploy
    • php bin/magento indexer:reindex
    • php bin/magento cache:flush


    This command uses to check the current execution mode of Magento.


    This command uses to install the new modules in Magento.


    This command uses to compile code like Factories, Proxies, Interceptors, etc., and puts them in generated or var/generation directory.


    This command helps to write static files to the Magento 2 file system. It uses to optimize static files properly, allowing for a better user experience.

    indexer: reindex

    The Mangeto indexer: reindex command uses to update the transformed data as the data changes.

    E.g.: when updating a product price the data should be reindexed to be correctly displayed on the frontend.


    This command uses to remove all stored data from the cache, so it may affect the performance of other processes using the same storage.

    Explore more about Magento commands.

    Next Blog -> Magento 2 Area codes

    Previous Blog -> Magento Architecture

    . . .

    Leave a Comment

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

    Be the first to comment.

    Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home