Download sample data Composer packages

This section discusses how to install sample data if you got the Adobe Commerce or Magento Open Source software in any of the following ways:

  • Downloaded a compressed archive from https://magento.com/tech-resources/download.

    If you downloaded an archive from GitHub, this method doesn’t work because the composer.json file doesn’t contain the repo.magento.com URL.

  • Used composer create-project

You can use this method of getting sample data for both Adobe Commerce and Magento Open Source, but you must use the same authentication keys that you used to install the application.

NOTE
If you encounter errors, such as Could not find package... or ...no matching package found..., make sure that there aren’t any typos in your command. If you still encounter errors, you may not have access to the right Composer repositories, especially if your using Adobe Commerce. Contact Adobe Commerce Support for help.

You can use Composer to install sample data either before or after installing the application; however, there might be additional tasks.

If you’re a contributing developer, refer to Install by cloning repositories.

WARNING
Do not install sample data if your application is set for production mode. Switch to developer mode first. Installing sample data in production mode fails.

To install sample data using the command line, enter the following command as the file system owner in the <app_root> directory:

bin/magento sampledata:deploy
WARNING
If you’re installing sample data after installing the application, you must also run the following command to update the database and schema in the <app_root> directory:
bin/magento setup:upgrade

You are required to authenticate to complete the action.

Authentication error

The following authentication error might display:

[Composer\Downloader\TransportException]
The 'https://repo.magento.com/packages.json' URL required authentication.
You must be using the interactive console to authenticate

If the error displays, change to your application installation directory and run composer update, which prompts you for your authentication keys.

Complete the sample data installation

After you download the sample data packages, log in to your application server as, or switch to, the file system owner and enter the following command in <app_root> directory:

bin/magento setup:upgrade
recommendation-more-help
0f8e7db5-0e9c-4002-a5b8-a0088077d995