In this post we are discussing about how we can update/upgrade Magento 2 using command line

First of all you need the ssh access and login with the username and password and move to the root directory in which Magento 2 is installed

Then you need to run this commands one by one

composer require magento/product-community-edition 2.2.3 --no-update
composer update
rm -rf var/di var/generation
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex

Here 2.2.3 is the latest version of Magento 2, you can change this to what ever versions and can be found here

After all these commands executed ,check your Magento version with the following command:

php bin/magento --version

One Comment on “Updating/Upgrading Magento 2 using Command Line

  1. Alex Morco
    June 25, 2018

    Nice article, I got help while working on Magento 2 CLI.

    I have done with following:
    Setup (Backup, Config)

    and for Admin I also got help from this post,, hope it will help your readers as well.

Leave a Reply

Your email address will not be published.