How to install Adobe Commerce (Magento) extension

Home / Blog / How to install Adobe Commerce (Magento) extension


Installing a Magento extension is a key way to enhance your store’s features, but it requires careful preparation and the right approach for your environment. There are three main methods: manual installation, installation via Composer, and installation directly from the Magento Marketplace. Each has its own best practices and steps, which are outlined below with practical examples.

Preparation: Best Practices Before Installation

Before installing any extension, follow these essential steps to ensure a smooth process and avoid conflicts:

  • Choose a reputable extension provider to minimize compatibility and security risks.

Back up your Magento store, including code, media, and database. You can use the command:

php bin/magento setup:backup --code --media --db

Check that your PHP version matches the extension’s requirements by running `php -v`.

Enable maintenance mode to prevent customer disruptions during installation:

php bin/magento maintenance:enable

If possible, test the extension on a staging environment before deploying to production.

Manual Installation (ZIP File Upload)

Manual installation is often used for extensions downloaded as ZIP files from third-party developers or the Magento Marketplace.

Steps:

  • Extract the extension ZIP file on your local machine.
  • Upload the extracted files to the app/code/Vendor/ModuleName directory of your Magento installation. If the code directory doesn’t exist, create it.

Connect to your server via SSH and navigate to the Magento root directory.

Run the following commands to register and deploy the extension:

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

Confirm the extension is enabled in the admin panel under Stores > Configuration > Advanced > Advanced.

Example:
Installing a blog extension manually:

  1. Download and extract the ZIP.
  2. Upload to app/code/Magefan/Blog.
  3. Run the Magento CLI commands above.

Composer Installation

Composer is the recommended method for most Magento 2 extensions, especially those from the Magento Marketplace or reputable vendors, as it handles dependencies and updates more efficiently.

Steps:

  • Obtain the extension’s Composer package name and version from the Marketplace or vendor documentation.
  • If required, generate Magento Marketplace access keys and add them to your Composer configuration.

In your Magento root directory, run:

composer require vendorname/module-name:version

For example:

composer require mageplaza/module-google-recaptcha:4.0.0

Complete the installation with:

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

Verify the extension is enabled and functioning as expected.

Example:
Installing Mageplaza’s Google Recaptcha extension:

  1. Run composer require mageplaza/module-google-recaptcha:4.0.0.
  2. Execute the Magento CLI commands above.

Magento Marketplace Installation

When purchasing from the Magento Marketplace, you can install via Composer (as described above) or use the Web Setup Wizard (if available in your Magento version).

Web Setup Wizard Steps:

  • In the Magento Admin, go to System > Web Setup Wizard > Extension Manager.
  • Sign in with your Marketplace public and private keys.
  • Click “Review and Install,” then select the extension to install.
  • Follow the prompts, including readiness checks and backup options.
  • Complete the installation as guided by the wizard.

Note: The Web Setup Wizard is deprecated in recent Magento versions; Composer is the preferred and most future-proof method.

Manual vs Composer vs Marketplace: Comparison Table

| Method        | Pros                                 | Cons                                         | Example Use Case                         |
|---------------|--------------------------------------|----------------------------------------------|------------------------------------------|
| Manual (ZIP)  | Simple for small, custom modules     | No dependency management; manual updates     | Custom/private extensions                |
| Composer      | Handles dependencies, easy updates   | Requires CLI and Composer knowledge          | Marketplace and popular third-party mods |
| Marketplace   | Integrated with Magento account      | Setup Wizard deprecated in newer versions    | Official Marketplace purchases           |

Final Tips

  • Always clear cache and reindex after installation.
  • Check extension documentation for any additional steps.
  • Test thoroughly on staging before deploying to live.

By following these best practices and choosing the right installation method, you can safely and efficiently extend your Magento store’s capabilities.


Written by X2Y.DEV
Adobe Commerce (Magento) Extension Module Guide

0%