How to install Magento Sample data using command line?

1 Answer 1


Run the following CLI command to install Magento 2 sample data.

php bin/magento sampledata:deploy

Add Access Key. You can get from Market Place

Note: If you get a memory error message, run the following command.

php -d memory_limit=2G bin/magento sampledata:deploy

After successfully installing Magento2 sample data, run the following commands one by one.

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.