The starting point for exploring the broad advantages and capabilities of Magento 2 is to download and install the platform.
Despite the awesome functionality Magento 2 is harder to install than the previous version of software. This necessitated the emergence of multiple installation guides across the Internet. But, most of them point at the manual way of installation, or cast a lot of console spells to install different server-side software, or just loose their relevance gradually. On the other hand, there is a bunch of ready Magento 2 stores installed in online demos, but most of them are also outdated. Besides, in this case you can't play around with files, command-line scripts, tests, etc. Rapid obsolescence is pretty natural since Magento 2 is still in Beta and the code is subject to change until the GA release. Nevertheless, our ultimate goal is to overcome this obstacle and always have available a fresh Magento 2 version. Below we share, we believe, a great way to install the latest Magento 2 any time you follow this guide. The solution uses Vagrant and Puppet to setup a full-featured Ubuntu box with Magento2 inside. All you need is to install VirtualBox and Vagrant, launch a couple of commands, and enjoy the freshest M2 already running.
Magento 2 Installation
Vagrant Configuration to Run Magento 2
This Vagrant configuration sets up the required environment and installs the latest available Magento 2 running on Ubuntu 14.04.3 LTS (Trusty Tahr). Box Contents
- Ubuntu 14.04.3 LTS (Trusty Tahr);
- Apache 2.4 with mods enabled;
- MySQL 5.6;
- PHP 5.5.9 with all the extensions required for Magento 2;
1. Install VirtualBox;
2. Install Vagrant;
3. Install the vagrant-puppet-install plugin by executing vagrant plugin install vagrant-puppet-install;
4. Download/clone and change the directory of this repository to its root;
5. [Optional] Configure variables inside Vagrantfilelike: port, hostname, docroot, etc.;
6. Run vagrant up and give it some time to install all the stuff for you. This will automatically download and configure the box and install all required software;
7. Edit your host files (/etc/hosts on OSX/Linux, Windows\System32\Drivers\etc\hosts on Windows) and add the line 127.0.0.1 magento2.dev. If you changed the hostname in Vagrantfile, be sure to replace magento2.dev with it.
8. When Vagrant will complete the installation, open http://magento2.dev:7654 in your browser.
This method of installation has several obvious advantages over the other ways:
- You don't mess up your PC with web servers or a database server, etc. All is under the hood of the Vagrant box;
- It doesn't require configured remote hosting;
- We used Puppet inside, so it can be easily customized, extended and contributed by the community;
- Most of PHP IDEs come with the perfect Vagrant integration;
- It takes the latest Magento 2;
- This configuration can be easily adapted to your needs, if you are an extension developer or building your own store.
You may ask any questions regarding the installation just here in the comments below or you can enter this project on BitBucket.
- Run vagrant provision, if you change something in the Vagrant/Puppet configuration;
Run vagrant reload to reboot your box;
Run vagrant destroy to remove the box completely;
Run vagrant ssh to start a SSH session;
If vagrant plugin install vagrant-puppet-install fails to run, just re-run it again, as it is a known issue for some Vagrant plugins;
Report any issues on the installation.
This is how we see a good way of Magento 2 installation, but we welcome other smart tips and valuable contributions to the process. Feel free to add them in the comments below or directly on BitBucket.