Install your generated module – Mage2gen

When you have generated your first module with Mage2gen it’s really easy to install the module in your Magento 2 Installation.

First take a look at Your First Generated Module – Mage2gen before starting this article.

There are several options available to do this:

  • Directly download a zip file
  • Download and Extract through the console with curl
  • Download and Extract through the console with wget

I prefer to use the Download and Extract commands so you can also run the Magento 2 Commands to enable the module directly after installing for the first time.

1. Copy the Magic Command

Click on the right hand side on Save and Download module

Now you see the following popup

Then copy one of the 2 available commands according to your preference.

Go in to your shell

Open your Magento 2 Installation on your machine or maybe on a server through ssh. Then just paste the command and it will automatically create an app/code/Vendorname folder path when it doesn’t exists yet and it will retrieve the tar file and untar it for you.

Install & Enable the Module

Now follow the instructions which are added to the generated file, which are also shown below

  • enable the module by running php bin/magento module:enable Mage2gen_Example
  • apply database updates by running php bin/magento setup:upgrade
  • Flush the cache by running php bin/magento cache:flush

You have just installed your generated module!