How to update Magento community edition using CLI

composer require magento/product-community-edition 2.2.6 --no-update composer update rm -rf var/di var/generation var/cache var/view_preprocessed generated/* 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 php bin/magento deploy:mode:set production if you receive any errors post installation, try this hard fix rm -rf app/code/Magento/ var/* vendor/* chmod 777 -R * composer update && composer install php -f bin/magento setup:static-content:deploy find . -type d -exec chmod 775 {} find . -type f -exec chmod 660 {} chmod u+x bin/magento bin/magento maintenance:disable bin/magento cache:clean

February 1, 2018 · 1 min · Harshvardhan Malpani