This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

✨ Vultr and Linode are back on Cloudways! VIEW PLANS→

Magento 2 Sample Data: Step-by-Step Guide

Updated on December 23, 2021

4 Min Read

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.

Let’s begin.

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.

Secure and Migrate your Magento 1 Store using Cloudways without breaking anything

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.

Experience the Cloudways Magento 2 Demo Store – No tech skills needed!

Experience a fully functional Magento 2 store built on top of renowned Cloudways hosting to deliver the fastest speeds.

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.

root directory magento 2 sample data

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

deploy magento 2 sample data

4. To authenticate from, enter your username, and password.

authenticate magento 2 sample data

5. Log in to your Magento marketplace account and click My Profile on the top right corner of the page.

click on my profile magento 2 sample data

6. Click  Access Keys in My Products section under the Marketplace tab.

click on acess keys magento 2 sample data

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.

create a new access key magento 2 sample data

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’:

authenticate yes magento 2 sample data

8. Hit  Enter to start the Magento 2 sample data installation process.

hit enter magento 2 sample data

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.

magento 2 sample data installed

Congratulations! You have successfully installed Magento Sample data.

Optimize Magento Speed Like a Pro

Subscribe now and get a free ebook to your inbox.

Thank You

Your Ebook is on it’s Way to Your Inbox.

Frequently Asked Questions

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:

bin/magento sampledata:deploy

Next, run the command:

bin/magento setup:upgrade

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:

bin/magento sampledata:remove

Final Thoughts

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!

Share your opinion in the comment section. COMMENT NOW

Share This Article

Abdur Rahman

Abdur Rahman is the Magento whizz at Cloudways. He is growth ambitious, and aims to learn & share information about Ecommerce & Magento Development through practice and experimentation. He loves to travel and explore new ideas whenever he finds time. Get in touch with him at [email protected]


Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!


Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Want to Experience the Cloudways Platform in Its Full Glory?

Take a FREE guided tour of Cloudways and see for yourself how easily you can manage your server & apps on the leading cloud-hosting platform.

Start my tour


  • 0


  • 0


  • 0


  • 0



For 4 Months &
40 Free Migrations

For 4 Months &
40 Free Migrations

Upgrade Now