Installing a Magento 2 extension from Marketplace using command line




Not many people are aware yet that Magento 2's Web Setup Wizard is a UI sitting on top of Composer. Because of this you do not need to use the graphical interface if you prefer to use the command line or would like to script the installation of an extension. The below commands run from your Magento 2 root folder will install an extension that you have previously ordered through Marketplace.

#1. Create a Backup making sure we stay in Maintenance Mode
php -f bin/magento setup:backup --code --db --media && php -f bin/magento maintenance:enable
#2. Install via Composer, copy the Component Name from your Marketplace > My Purchases
php -f vendor/composer/composer/bin/composer require fooman/ordermanager-m2

Username: < Enter your Marketplace Public Key >
Password: < Enter your Marketplace Private Key >  

For the above Public/Private Key pair please see here on how to create one for this site.

#3. List all modules - find your new module name under "List of disabled modules"
php -f bin/magento module:status
#4. Enable the new Extension
php -f bin/magento module:enable Fooman_OrderManager --clear-static-content
#5. Run database installation upgrades
php -f bin/magento setup:upgrade
#6. Remove previously compiled classes
rm -rf var/generation
#7. Compile (only needed in Production Mode)
php -f bin/magento setup:di:compile
#8. Deploy Static Content (only needed in Production Mode)
php -f bin/magento setup:static-content:deploy
#9. We are all done - take the store out of maintenance
php -f bin/magento maintenance:disable
Kristof Ringleff

Kristof Ringleff

Founder and Lead Developer at Fooman

Join the Fooman Community

We send our popular Fooman Developer Monthly email with Magento news, articles & developer tips, as well as occasional Fooman extension updates.