1

How can you install a Magento 2 quickly to last version with sample data with composer

Can you install a Magento2 last version with sample data with composer?

4
  • "how quickly"? What kind of answer to you expect to that? It depends on the speed of your internet connection. Dec 22, 2016 at 22:18
  • Hey Dude, "php bin/magento setup:install ..." this is quickly, not in browser
    – St3phan
    Dec 23, 2016 at 21:02
  • Oh, you meant "how can you install Magento2 quickly" - sorry for the misunderstanding Dec 23, 2016 at 22:41
  • It's ok now ? @fschmengler
    – St3phan
    Dec 26, 2016 at 21:15

2 Answers 2

4

Run command to bring Magento2 from the repository:

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento

Add the credential for Username and Password for authentification on the terminal, your credential is in your Magento.com account after you logged in click here.


After ruling the composer command you have to enter in the magento folder that was created by the composer

cd magento

Add Magento2 Sample Data with composer:

php bin/magento sampledata:deploy

Add the credential for Username and Password for authentification on the terminal, your credential is in your Magento.com account after you logged in click here.


Create database and completes below with the following command: database name, database user, database password, domain, First Name, Last Name, Email address, user admin, admin password, admin path

Then rule the command for install Magento2 in terminal:

php bin/magento setup:install --base-url=http://domain.com/ --db-host=localhost --db-name=db_name --db-user=db_user --db-password=db_pass --admin-firstname=FirstName --admin-lastname=LastName [email protected] --admin-user=admin --admin-password=password --language=en_US --backend-frontname=admin --use-sample-data --magento-init-params=“MAGE_MODE=developer”


And now you can enjoy Magento2.

0

I've developed m2install tool for such purpose.

  • Generate your auth keys and put them into file ~/.composer/auth.json see more details

  • Run from command line: m2install.sh -s composer -v 2.1.3 --sample-data yes

Link on GitHub project: https://github.com/yvoronoy/m2install

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.