After Installing Magento 2, you can download the sample data like products, categories, customers, orders etc for testing purposes. Magento provides a repository for ready-to-use data. You can either clone that repository or install the sample data by command line. Here we discuss how to install sample data using the command line.
Below are steps to install sample data in Magento 2 using composer:
Step 1: Open Magento 2 SSH with the user with write permission.
Step 2: Run the below command.
php bin/magento sampledata:deploy
Step 3: Run the below command once sample data installation is completed.
php bin/magento setup:upgrade
After that log in to Magento admin and you can see sample products, categories, customers, orders etc.