Magento 2 Install sample data using composer or deploy sample data.

Magento 2 install using composer:

Step 01:

First to add dependencies in the composer.json file.

Composer Dependencies Cli:

composer require magento/module-bundle-sample-data magento/module-widget-sample-data magento/module-theme-sample-data magento/module-catalog-sample-data magento/module-customer-sample-data magento/module-cms-sample-data magento/module-catalog-rule-sample-data magento/module-sales-rule-sample-data magento/module-review-sample-data magento/module-tax-sample-data magento/module-sales-sample-data magento/module-grouped-product-sample-data magento/module-downloadable-sample-data magento/module-msrp-sample-data magento/module-configurable-sample-data magento/module-product-links-sample-data magento/module-wishlist-sample-data magento/module-swatches-sample-data magento/sample-data-media magento/module-offline-shipping-sample-data –no-update

Step 02:

Run composer update Cli:

composer update

After composer update, you can see the sample data in your magento store. If you could not see the sample data then run reindex and cache clean commands.

Magento 2 deploy sample data:

Step 01:

php bin/magento sampledata:deploy

After sampledata deploy cli, you will require to authenticate to complete the action. (https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html)

Step 02:

Upgrade magento cli to upgrade magento files:

php bin/magento setup:upgrade

After deploy sample data, you can see the sample data in your magento store. If you could not see the sample data then run reindex and cache clean commands.