Magento 2 Extension

Magento 2 Extension tutorial, learn what is a Magento 2 Extension how to install or disable in your Magento store.

What is Magento 2 Module or Extension #

A Magento 2 Module or Extension, sometimes a Magento 2 Plugin, is a piece of code that extends the Magento 2 Core, out-of-the-box, functionality.

How to install Magento 2 Extension #

Extension Install #

Magento 2 extension installation guide to install the Magento 2 modules.

Extension install admin #

Extensions can be installed using the Web Setup Wizard provided by Magento in backend. This is the simplest option and less technical as you only needed to login into your Magento 2 Admin area and use a GUI.

  • The option to Upgrade via Wizard is in the backend under a menu option System > Tools called Web Setup Wizard.

If you don’t see such a option don’t worry, there is a bug that hides the option, you can directly access it via:

http://www.example.com/admin_xxxx/admin/backendapp/redirect/app/setup/

Replace http://www.example.com/admin_xxxx/ with your backend url in the browser url input and hit enter.

Web Setup Wizard

  • Click Extension Manager, then click Sign In.

  • (Optional) If you have never used the Magento Marketplace before you will be required to add the Magento Marketplace credentials. Credentials can be obtained from Marketplace and added as per image below.

Magento Marketplace Access Keys

  • Enter Public Access Key, Private Access Key and Click Submit.

  • At this point you will have to wait a few minutes for Magento to generate a summary list of all available updates, any recently purchased extensions / currently installed extensions / sample data.

Extension Manager

  • Click on Extensions Ready to Install, this will take to to the gird with all the extensions available in your account to install.

Extension Manager - Ready to Install

  • Select the extensions you wish to install from the list and click on Install under the Action column.

  • Go through the 3 steps Readiness Check, Create Backup, Component Install.

  • Flush Caches always after installing a extension.

Extension Install from zip file #

How to install Magento 2 extension from a zip file ? For this you need the .zip, .tar, .tar.gz archive from your extension Vendor. Extract the contents into your Computer.

  • Use a SFTP / FTP client to get in the hosting server and go the the Magento Root folder (you should see a file CHANGELOG.md in it).
  • Go to /app/code/ folder.
  • Copy the contents of the archive to this folder.
  • Check after copying that the paths are /app/code/Vendor/Module.

Extension Enable #

Extension Enable Admin #

Extension Enable Command-Line #

To enable a Magento 2 Extension run you can execute the command line:

php bin/magento module:enable <Vendor_Module>

This will show in the console something like:

The following modules have been enabled:
- <Vendor_Module>

To make sure that the enabled modules are properly registered, run 'setup:upgrade'.
Cache cleared successfully.
Generated classes cleared successfully. Please run the 'setup:di:compile' command to generate classes.
Info: Some modules might require static view files to be cleared. To do this, run 'module:enable' with the --clear-static-content option to clear them.

Replace <Vendor_Module> with the module you wish to enable.

We always recommend to include the --clear-static-content argument as it prevents potential issues with file fallback.

php bin/magento module:enable <Vendor_Module> --clear-static-content

This will output:

The following modules have been enabled:
- <Vendor_Module>

To make sure that the enabled modules are properly registered, run 'setup:upgrade'.
Cache cleared successfully.
Generated classes cleared successfully. Please run the 'setup:di:compile' command to generate classes.
Generated static view files cleared successfully.

After the extension is enabled it’s important to also run:

php bin/magento setup:upgrade

and after:

php bin/magento setup:di:compile

Extension Disable #

Extension Disable Admin #

Extensions can be disabled via admin area also.

Extension Disable Command-Line #

To disabled a Magento 2 Extension you can execute the command line:

php bin/magento module:disable <Vendor_Module>

Replace <Vendor_Module> with the module you wish to disable.

This will output something like:

The following modules have been disabled:
- <Vendor_Module>

Cache cleared successfully.
Generated classes cleared successfully. Please run the 'setup:di:compile' command to generate classes.
Info: Some modules might require static view files to be cleared. To do this, run 'module:disable' with the --clear-static-content option to clear them.

We always recommend to include the --clear-static-content argument as it prevents potential issues with file fallback.

php bin/magento module:disable <Vendor_Module> --clear-static-content

Need help with Magento 2 Extension ?