Magento is the most popular CMS for ecommerce stores that offers many useful features to customize store performance, thus helping store owners provide a great experience to their customers.
People in the Magento community often ask about the Magento sample data. In this blog, you will learn to install Magento 2 sample data on your ecommerce store for testing performance and scalability – the two major aspects of any successful online store.
First of all, you must understand what Magento Sample Data is all about.
In this article, I’ll show you an easy way to clean your Magento database.
What is Magento 2 Sample Data?
Magento sample data provides online store owners with a storefront powered by the Luma theme. It works like a typical Magento storefront and helps store owners manipulate pricing, inventory, promotional pricing rules from the Magento Admin Panel.
There are three important factors that an online store owner must consider before opting for any ecommerce platform. These factors include performance, user experience, and scalability. The ecommerce store must have a certain number of products in stock to test store performance. Magento 2 sample data allows you to add around 250 products under different categories for testing the store’s performance.
Now, it is time to learn to install Magento sample data.
Install Magento 2 Sample Data
1. Launch SSH terminal to connect your Magento store
2. Navigate to the root directory (public_html) of your Magento 2 store.
Scalable, Super Fast, & Secure Magento Hosting
Our clients love us because we never compromise on these features
3. Run the following CLI command to install Magento 2 sample data.
php bin/magento sampledata:deploy
4. To authenticate from repo.magento.com, enter your username, and password.
5. Log in to your Magento marketplace account and click My Profile on the top right corner of the page.
6. Click Access Keys in My Products section under the Marketplace tab.
If you already have an access key, you can use that. Otherwise, you must create a new key. For this purpose, click Create A New Access Key.
You will get two types of keys: a public and a private one.
- Public Key: Use this public key as your username.
- Private: Use this private key as your password.
7. Go back to the SSH terminal and enter your username, password and Type ‘Y’:
8. Hit Enter to start the Magento 2 sample data installation process.
Note: If you get a memory error message, run the following command.
php -d memory_limit=2G bin/magento sampledata:deploy
9. After successfully installing Magento 2 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
10. Navigate to your store’s front page.
Congratulations! You have successfully installed Magento Sample data.
Optimize Magento Speed Like a Pro
Subscribe now and get a free ebook to your inbox.
Your Ebook is on it’s Way to Your Inbox.
Q: What is Magento sample data?
A: Magento sample data is a great way of stress testing your Magento store. In essence, this data provides a working storefront with Luma theme. With this data, you can configure all the settings and rules from the Admin Panel.
Q: How do I deploy sample data in Magento 2?
A: The easiest way of installing sample data for Magento 2 is through Composer.
First switch to developer mode. Next, go to the magento_root folder and run the command:
Next, run the command:
Q: How to install Magento 2.4 with Composer?
A: Installing Magento 2.x through Composer is a four-step process.
Start by installing Composer (if it is not available already). Next, download Magento 2. Set up permissions and create the database. Finally, initiate Magento 2 installation.
Q: How can I delete sample data in Magento 2?
A: Use the following command to remove sample data without damaging your Magento installation:
The sample data helps store owners conduct tests – for performance and scalability – with ease. The process outlined in this blog will help you install Magento 2 sample data seamlessly. Using Magento sample data, you can test server load as well.
In this tutorial, I have covered every aspect of Magento sample data installation for ecommerce stores. If you’re still confused about the process, feel free to drop your comment(s) below. I will get back to YOU!
Customer Review at
“Great speed, features, knowledgebase, dashboard, UX and fast, expert support. Very happy!”
Stefan [Management Consultant]
Syed Muneeb Ul Hasan is a Magento Community Manager at Cloudways - A Managed Magento Hosting Platform. He is an expert in PHP and Magento and prefers to educate users in the implementation of Magento. When not working, he loves to play games and watch cricket.