Installation extensions in Magento 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 extensions in Magento using both of them.

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

Magento 2 Install Extension via Composer

Firstly, the composer is the package manager for PHP, it allows you to manage dependencies of extensions and PHP libraries. It also facilitates Magento and extension upgrades.

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

To install extensions 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 modules in Magento via composer. We've used  Magento 2 Blog for this example.

Magento 2 Install Extension via Archive

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

1. Download the 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.