Magento 2 extension installation is not a difficult task. Yet, it can be quite challenging if you only start working with this eCommerce platform. You can install extensions in Magento using composer or archive installation methods.

Today you'll learn how to install Magento extension using both of them.

Not ready to install Magento 2 extension on your own yet? Let our technical engineers do it for you — check out our installation service.

Install Magento Extension via Composer

Firstly, the composer is the package manager for PHP, it allows you to manage dependencies of Magento 2 extensions and PHP libraries. It also facilitates the upgrade process of Magento2 & Magento2 Extensions.

Note: it's recommended to install Magento 2 extensions via composer. But not all vendors provide such a possibility. Yet, all the Magefan extensions can be installed via composer.

To install extension in Magento 2:

1. Open the command line.

2. Using the command "cd" navigate to your Magento 2 root directory.

3. Run CLI commands:

composer require vendorname/module-name
# Authentication required (repo.magento.com)
# Get your Magento Marketplace authentication keys or use these:
# Username: 7c018006799466c681ad507e27904677
# Password: 289077c86e811661a8f7751828485d3a php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

Note: if you don't want your website to be down during deployment, try these zero downtime deployment commands for Magento 2.

The composer package name of the extension is vendorname/module-name. You can get it from the module vendor. If you have received the message "No command 'composer' found" during the installation, please, install composer first.

In the short demo video below, you can see how to install Magento extension via composer. We've used Magento 2 Blog for this example.

Install Magento Extension using Achive

This method's been the most common since Magento 1.x times. Please, follow the steps below to install Magento module using the archive:

1. Download the Magento 2 extension archive.

2. Extract files.

3. Upload the "app" folder from the archive over FTP or SFTP to your Magento 2 directory on the web server.

Magento 2 directory

4. In a command line, using "cd", navigate to your Magento 2 root directory.

3. Run CLI commands:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

Was it hard? As we've told you before, installing extensions in Magento is quite easy. You just need to follow the right steps. However, remember that each vendor might have their custom installation instructions. 

That being said if you want to install any of the Magefan extensions, check out the user guides for proper instructions.