Skip to content

Instantly share code, notes, and snippets.

@DirtyF
Last active September 13, 2015 10:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DirtyF/c42d87cea2bdc419c474 to your computer and use it in GitHub Desktop.
Save DirtyF/c42d87cea2bdc419c474 to your computer and use it in GitHub Desktop.
Magento 2 five minutes install

Magento 2 0.42.0-beta1 is available since a few days. In order to test it right away, we will see how to install a running demo in 5 minutes sharp thanks to Docker. If you don't know Docker, please report to our previous tutorial.

We will even go further and give you the choice between two types of setup:

  • a read-only discovery mode running instance of Magento 2 in order to discover the new admin interface and click
  • a developer mode, in order to have a development environnement and start playing with the brand new technical features of Magento 2.

Disclaimer : We assume you have a running and fonctionnal Docker on your computer.

Discovery mode

Ready ? Go and open a terminal, then copy/paste the following shell command (just adapt the password to your environnement)

docker run --name magento2_db -d -e MYSQL_ROOT_PASSWORD="motdepasseroot" -e MYSQL_DATABASE="magento2" -e MYSQL_USER="magento2" -e MYSQL_PASSWORD="motdepassemagento2" mysql
docker run --name magento2_web -d -p 80 --link=magento2_db:db chadrien/magento2:0.42.0-beta1
docker port magento2_web

That's it. You just have to copy the port that the last command just returned you and go to http://127.0.0.1:PORT in your favorite browser to start installing Magento 2 beta.

When asked for database information, set the host to db. For mySQL user, password, and database name, stick to what you entered in the previous MySQL Docker command.

If you stumble upon the following error message "Cannot determine required PHP extensions: Missing key 'platform-dev' in 'composer.lock' file", click on "Try Again" until "Next" is available. Then, at the final step, another message will warn you about an error, don't pay attention to it, it's a var_dump still present in Magento 2 codebase. When the progress bar reaches 100%, go back tohttp://127.0.0.1:PORT.

Magento 2 setup wizard

Magento 2 setup wizard

Developer mode

Disclaimer: We assume you have Composer and fig installed and functionnal on your computer

This will go quickly too, except that we will have to install Magento 2 locally this time.

Open a terminal and enter:

composer create-project -n magento/product-community-edition magento2 0.42.0-beta1 && cd magento2

Now add this fig.yml YAML config file for fig, don't forget to change the passwords :

web:
  image: chadrien/magento2:5.5-apache
  links:
    - db
  ports:
    - 80
  volumes:
    - ".:/var/www"
db:
  image: mysql
  environment:
    MYSQL_ROOT_PASSWORD: rootpassword
    MYSQL_DATABASE: magento2
    MYSQL_USER: magento2
    MYSQL_PASSWORD: mySQLuserpassword

Then we start our containers:

fig up -d
fig port web 80

Copy the port given by the last command and go to http://127.0.0.1:PORT so start Magento 2 setup wizard.

When asked for database information, set the host to db. For mySQL user, password, and database name, stick to what you entered in the previous MySQL Docker command (see above).

As you have the source code on your computer, you can start adding your modules in app/code, changes will be visible in Docker.


And voilà ! We felt it was important to share this in order to allow you tio get your hands on Magento 2 very quickly.

Bonus : You can grab the sample data on Github for your testing purpose, as they are not yet available by default.

@DirtyF
Copy link
Author

DirtyF commented Dec 20, 2014

I just translated this tutorial in English for Magenticians, all the credits go to @chadrien for the Magento2 docker images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment