Skip to main content

Magento Extension: Installation Guide for Developers

G
Written by Guido Kaspers
Updated today

This guide explains installing the Swap Magento Extension on a Magento 2 instance. Installation requires server access and should be performed by a developer familiar with managing Magento environments.


Before you begin

Before starting the installation, ensure your Magento 2 store is running correctly and you have full access to the server where Magento is installed. You will also need the latest Swap Magento Extension ZIP file, which the Swap team should provide during onboarding.


Uploading the extension to the server

The first step is to upload the extension package to your Magento server. The ZIP file should be placed in the appropriate directory within your Magento installation, typically inside the app/code directory.

For example, you can use the following command to upload the file to your server:

scp swap_module-1.0.0.zip {user}@{host}:{MAGENTO_PATH}/app/code/Swap

Replace {user}, {host}, and {MAGENTO_PATH} with your actual server details.


Extracting the extension files

Once the ZIP file is uploaded, connect to the server via SSH and navigate to the directory where you placed the file. You can then extract the contents of the extension by running:

unzip -o swap_module-1.0.0.zip

If you are upgrading from a previous version of the Swap Extension, make sure to first remove the existing extension files before unzipping the new version. You can do that with:

rm -rf {MAGENTO_PATH}/app/code/Swap/Extension/*


Enabling the extension in Magento

After the files have been extracted, you need to enable the module and complete Magento’s setup process. Run the following Magento CLI commands in order:

php {MAGENTO_PATH}/bin/magento module:enable Swap_Extension php {MAGENTO_PATH}/bin/magento setup:upgrade php {MAGENTO_PATH}/bin/magento setup:di:compile php {MAGENTO_PATH}/bin/magento setup:static-content:deploy -f php {MAGENTO_PATH}/bin/magento cache:flush

Each command ensures that Magento recognises the new extension, compiles necessary code, and updates caches.


Verifying installation

To confirm that the Swap Extension has been installed and enabled correctly, you can check the module status using the following command:

php {MAGENTO_PATH}/bin/magento module:status Swap_Extension

If everything is installed properly, Magento will report that the module is enabled.


Next steps

Once the extension is successfully installed, the store admin can proceed with the configuration from the Magento Admin Panel. For details on how to complete the configuration, please take a look at the Configuration Guide for Admins.

If you encounter any issues during installation, you can contact your Swap onboarding manager for assistance.

Did this answer your question?