No image

Installing a Magento 2 Module

This article is NOT meant to replace the module author’s instructions; however, it is a handy supplement when things go wrong.

We use these same steps on our DevOps projects for Magento, and 99.9% of the time this process works without issue.

First, it is important to note that we are doing a manual module install from the command line [CLI] using our SSH client, Putty, as per our stack instructions.

Second, these instructions assume you have already SFTP’d the module to the proper directory path on Magento as per the author’s instructions.

Next we follow these set of commands:

cd /var/www/magento

Note: New stacks have these commands in a script called amistacx.sh in the Magento root directory. Make the file executable “x”, then run it:

sudo ./amistacx.sh

or the old long way..

sudo redis-cli flushall
sudo php bin/magento maintenance:enable
sudo php bin/magento cache:clean
sudo php bin/magento cache:disable
[Optional] sudo php bin/magento deploy:mode:set developer
sudo chown -R www-data:www-data /var/www/magento
sudo php bin/magento setup:upgrade
sudo chmod -R u+rwX,go+rX,go-w /var/www/magento
sudo chown -R www-data:www-data /var/www/magento
sudo php bin/magento setup:di:compile
sudo chown -R www-data:www-data /var/www/magento
[optional] sudo php bin/magento setup:static-content:deploy -f
sudo chown -R www-data:www-data /var/www/magento
sudo php bin/magento cache:clean
sudo php bin/magento cache:enable
sudo php bin/magento maintenance:disable
sudo chown -R www-data:www-data /var/www/magento

After these steps are completed, you can log into the Magento admin console, and go to the Magento Component Manager to verify installation, or you can run this command, and check the status of the module:

sudo php bin/magento module:status

Tip! Make sure you are installing a module for the correct version of Magento! Many times customers report issues to us only to later discover that they were attempting to install an M1 module on M2. Also make sure the php version running is compatible with your module.

Good to go!

Next >> Theme Installs on M2

Comments are closed.