How to install sample data for Magento 2 using composer
Hi Everybody. I am Cuong, Welcome to my Magento 2 tutorial video series.
Today, I will show you a best practice about How to install sample data for Magento 2 using composer after you have already installed the Magento 2 software.
Okie, you can install sample data by following the below steps:
Step 1: You need to create an authentication key from the Magento Marketplace
– Log in to the Magento Marketplace at the link If you don’t have an account, click Register.
– Click your account name in the top-right of the page and select My Profile.
– Click Access Keys in the Marketplace tab.
– Click Create a New Access Key. Enter a specific name for the keys (e.g., the name of the developer receiving the keys) and click OK.
– New public and private keys are now associated with your account that you can click to copy. Save this information or keep the page open when working with your Magento project. Use the Public key as your user name and the Private key as your password.
Step 2: Install sample data for Magento 2 using composer
To install sample data please using the command line: php bin/magento sampledata:deploy
After completing downloading the sample data packages, run the below commands line:
– Update the database and schema php bin/magento setup:upgrade
– Deploy the static content in the folder called pub/static/*
php bin/magento setup:static-content:deploy (Applying for Magento 2.1.x)
php bin/magento setup:static-content:deploy -f (Applying for Magento 2.2.x)
– Compile the source code php bin/magento setup:di:compile
Step 3: Test and See the results
Go to the homepage.
Go to the backend.
Thank you for your watching. If you have any questions about this best practice please feel free to leave a comment below.
Don’t forget to like, comment, share and subscribe to my channel.
If you have the Magento projects that you want me to join it, please contact me via
The Skype: cuongnq87
The fan page:
I am willing to support you, my rate is $30/hour in Magento 2 and $25/hour in Magento 1.