User Tools

Site Tools



Composer User Guide

In this guide you can find out how to install Magento 2 extensions via Composer.

This manual assumes that you have already installed and set up the Composer tool. If you haven't installed the Composer yet see the instruction on How to install it.

To work with the Amasty Composer you need to create a Customer Account on (to get Access Keys).

Extension Installation via Composer

Step 1. Log in to your server via a Command line:

Step 2. Set the directory where you would like to install the extension. Usually, for such purposes, the Magento root folder is selected.

Step 3. Connect to the Amasty Composer Repository:

 composer config repositories.amasty composer <path>

In the <path> indicate:


    - for community extensions.


    - for enterprise extensions.

Step 4. To get authorized use Access Keys generated in your Customer Account :

Amasty.comAccountMy Access Keys

You will be asked for login and password when you try to install the package from Amasty composer repository for the first time. Use the Public Key as a login and the Private Key – as a password.

You can manually save the keys in the repository, so you won’t have to get authorized every time.

Find the Magento docroot directory or a directory that you have configured as a virtual host docroot and indicate:


where $COMPOSER_AMASTY_USERNAME is your Public Key and $COMPOSER_AMASTY_PASSWORD is your Private Key.

Step 5. After the authorization is successfully finished, you can start installing/updating your modules.

First, take a look at the module names in your Customer Account to make sure you call the necessary module via the Composer correctly.

Please go to Amasty.comAccountMy Downloads for paid extensions and open the My free products tab for free modules.

You will find module names for the Composer in the 'My Composer Packages' section.

Step 6. To install the module, please execute the following command:

 composer require amasty/color-swatches-pro 

Instead of the 'color-swatches-pro' please specify the module you need.

Step 7. To upgrade the module please execute the command:

 php bin/magento setup:upgrade 

Extension Update via Composer

The extension update process is the same as the module installation process. To update the extension, simply execute the command:

 composer update  <composer_name> 

Instead of the 'composer_name' please specify the corresponding module name which is indicated in your customer account.

IMPORTANT: This command updates only the last two version numbers: e.g. 1.x.x ( only x.x will be updated).

To update the version from 1.x.x to 2.x.x you need to execute the following command:

composer require <composer_name> ^x.0.0 --update-with-dependencies 

Where x corresponds to the first version number. For example, to update the Improved Layered Navigation Extension for M2 from the 1.x.x version to the 2.x.x version you need to execute the command:

 composer require amasty/shopby ^2.0.0 --update-with-dependencies

To update all modules execute the command:

 composer update 

Delete Extension via Composer

To delete the extension via Composer, please execute the command:

 composer remove  <composer_name> 

Instead of the 'composer_name' please specify the corresponding module name which is indicated in your customer account.

Using Composer with multiple accounts and one Magento installation

There are seven Amasty repositories (for both Community and Enterprise editions):

They are completely identical, therefore you can add several of them using different customer accounts.

For example:

composer config repositories.amasty_account1 composer
composer config repositories.amasty_account2 composer

The way you name them, will not affect their behavior.

This way you will have two repositories added with different customer credentials. Using several Amasty repositories does not affect the way composer commands are executed. In other words, to install the Improved Layered Navigation extension, please use the same command as usual:

composer require amasty/shopby

magento_2/composer_user_guide.txt · Last modified: 2021/06/29 12:10 by tihomirova