How to Install Magento Extension using composer
If you have purchased any Magento extension from Magento Marketplace, you can install that extension using the composer.
Installing the extension using the composer is an easy process but looks complicated as it involves CLI.
Using CLI (Command Line Interface) you can perform a numerous operation; a few of the important operations are as below which every Magento user needs.
- Installing Magento and Extensions
- Upgrading the Magento and Extensions to the latest versions.
- Uninstalling any module or extension.
- Clearing the cache.
- Reindexing the indexers of Magento to keep data up-to-date.
- Deploying Static Content view files.
- Enable and Disable any modules
- Compiling the code.
- Change mode of Magento i.e. developer or production
- Put the website on Maintenance mode.
- And many more…
Here we will discuss installing any extension using Composer using CLI in steps.
Note — You must have purchased the extension from Magento Marketplace before proceeding further
Step 1
Please make sure you have installed Magento 2, if not install it using CLI as explained in Install-cli or from Magento Setup Wizard by Downloading the Package.
Step 2
Open SSH Shell Command-Line and Enter Following Command.
in the following example, we are installing Purpletree Marketplace Extension. So if you want to install any other extension just put their vendor name in place of purpletree and module name in place of marketplace.
Example:
composer require purpletree/marketplace
Screenshot:
It will ask for Authentication Credentials for your Magento Marketplace account. For that Login to your account and go to Access Key area — Access Keys/ and copy Public key and Private Key.
Step 3
Create a new access key if not already, for Magento 2. Check this article for more details.
Step 4
Enter Your Username as a public key and password as a private key. These are the credentials using which you must have purchased the extension.
Step 5
After entering the credentials, your extension will be downloaded now you just have to install the extension by running the upgrade command. And your extension is ready to use. Run the following commands:
- php bin/magento setup:upgrade
- php bin/magento setup:static-content:deploy
Using the above steps you can easily install any Magento Extension which you have purchased from Magento Marketplace. Just make sure you have used the same credentials when you bought your extension and using it the same on the shell when validating it using the composer.
For the next steps how to configure Purpletree Marketplace extension or any other extension follow their respective documentation.