How to Install Shopware 6 Plugin from Store via Composer
Tomasz GajewskiReading Time: < 1 minute
Installing plugins with the composer is very handy when you deploy your Shopware 6 using a CD pipeline. The sources of the purchased plugins don't need to be pushed to your project code repository anymore. Thus the codebase becomes cleaner.
Prerequisites
- Create a Shopware account if you don't have one yet.
- Register your Shopware online store.
- At the Shopware Store purchase the plugin you would like to install and associate this plugin with your Shopware online store.
First Time Project Composer Configuring
Add the Shopware package repository to your composer.json
by running:
composer config repositories.shopware '{"type": "composer", "url": "https://packages.shopware.com/"}'
Authentication
Log in to your Shopware account. Select the shop in the Merchant area and scroll down to the plugin list. Select any of them and click "Install via composer". In the popup window, generate a new token if you don't have one yet. Copy and execute the command for setting up the authentication token:
composer config bearer.packages.shopware.com "abcdefABCDJDCCXXDLJJFghijklm,noppsdkd/.kkd=="
The token should be saved in auth.json
. It should look like this example below:
{
"bearer": {
"packages.shopware.com": "abcdefABCDJDCCXXDLJJFghijklm,noppsdkd/.kkd=="
}
}
Installing Shopware Plugin
Find the package you would like to install and run:
composer require store.shopware.com/plugin-packagename
Once it completes, run:
./bin/console plugin:refresh
Your freshly installed plugin should be visible in the list. Finally, execute the plugin install and activate commands to get the plugin active.
./bin/console plugin:install --activate pluginname
That's it, happy installing!