Updating your Magento 2 installation is very easy if you use composer. Below you will find all the steps you need to take to update the system quickly. Updating through composer can be done both with the Community Edition as well as the Enterprise Edition.
Open up your favorite CLI (Command Line Interface) and navigate to the root of your Magento 2 installation. Start to follow the steps outlined below.
- Download the update with composer that fits your version of the system (CE or EE). Please be aware that you need to change the version numbers to the most recent one when you’re reading this.
12345Community Edition:composer require magento/product-community-edition x.x.x --no-updateEnterprise Edition:composer require magento/product-enterprise-edition x.x.x --no-update
- Execute the update by using the following command
- Remove some folders
1rm -rf var/di var/generation
- Clear cache, upgrade, compile and reindex
1234php bin/magento cache:flushphp bin/magento setup:upgradephp bin/magento setup:di:compilephp bin/magento indexer:reindex
- Check the Magento 2 version number by running this command
1php bin/magento --version
You have now succesfully upgraded your Magento 2 installation with composer! If you have any more questions, don’t hesitate to ask us in the comments below this article, and we’ll answer them as soon as possible!