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

Leave a Reply

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