this tutorialThis article describes how to use Composer to install extensions from Magento Marketplace (repo.magento.com). For other sources (e.g. Github) please check the documentation/readme of the extension.
- "Buy" the extension on the Magento Marketplace (even if it is free), otherwise Composer cannot access it.
- Log in to your server via SSH and navigate into the Magento base directory.
- Execute these commands in the context of the webserver user, e.g. www-data.
If you are not logged in as webserver user, you can put sudo -u www-data (or the appropriate username) before every command. Do not execute these commands as root user.
composer require <vendor>/<extension> php bin/magento setup:upgrade php bin/magento cache:flush php bin/magento setup:di:compile php bin/magento setup:static-content:deploy <list_of_locales>
During installation, Composer might ask for a user and password. You must use the public and private key of the Magento Marketplace user which was used to purchase the extension.
The "list of locales" depends on the languages in the shop. Example: "en_US en_GB fr_FR de_DE it_IT" etc.
The command bin/magento setup:upgrade will enable the newly installed modules. This can be verified with:
php bin/magento module:status
The section "List of disabled modules" shows modules that have been explicitly disabled by the user. Those modules will not be re-enabled by bin/magento setup:upgrade and must be activated by hand if they are needed.
If the installation does not execute successfully and you get errors like "PHP Fatal Error", it might help to clear certain files/directories. See this tutorial.