Magento 2 Tutorials

Setting Up A Magento 2 Development Environment

Composer installing Magento 2 with Github faded in background

Preparing for the Magento 2 release, you might be inclined to set up a Magento 2 development environment. Whether you want to help with development or if you simply want to play around, here is a quick wrap-up to get you started.

Disclaimer

Update: As of alpha89 the relevancy of this quick tip is up for debate. Until we update the article, please check out Alan’s guide for setting up a Magento 2 Development Environment.

You are going to use unfinished, bleeding edge technology. Though this guide will help you with setting up a working system, it should not be used in production. Things might break without notice and there may be features which seem to work but actually don’t. Magento 2 is not ready yet.

On Github

In comparison to Magento 1.X, Magento 2 has a public repository located on Github where weekly updates are pushed. At the moment of writing the publicly available version is 2.0.0-dev71. Due to the massive commits pushed every Friday, it is highly unlikely that this is the main subversion-repository; there is probably an internal SVN-repository for the folks at eBay which is synchronized with Github periodically.

If you are looking to contribute to Magento 2, this is where it is at. You can simply fork the repository, make your changes and submit a pull request. By the looks of it, the Magento division over at eBay suffers from a lot of bureaucracy which results in very slow processing of issues and pull requests compared to other open source projects.

Downloading Magento 2

Because Magento 2 is hosted on Github, you have two options if you want to download the repository its contents: using git or a Github generated archive. For those not familiar with git, there is a download link which will automatically put all the contents of the repository in a zip file. After the download is complete, you can simply extract the contents to your web root.

Using Git

If you have git installed, navigate to your web root and issue a git clone https://github.com/magento/magento2.git command to download the repository. An advantage of using git is that you do not have to download the zip archive over and over again. As soon as you feel like synchronizing your local repository, you can issue a git pull or git fetch && git merge to process the updated files from the upstream repository on Github.

Using Composer

Magento 2 is still working on modularity improvements. Unknown whether all modules will be available as standalone-packages via Composer in the future, Magento 2 itself is already in its entirety available on Packagist aliased as magento/community-edition.

This means that alternatively to raw git, you can use composer create-project magento/community-edition [path] –stability=dev to fetch the repository (omit [path] to install in ./community-edition). To update your local version with the upstream, run composer update in the project root.

magento 2 login screen

The all new Magento 2 backend greets you

Installing Magento 2

Now you have the required files locally available, installation is a breeze. Create a new database, navigate to the root of your Magento 2 directory in your web browser and follow the steps in the familiar installer. Circa 300 tables and an admin user later, Magento 2 should be successfully installed.

Note that depending on your setup, during the installation process some directories might be marked as not-writable. Before continuing, you should fix these issues first.

Conclusion

Now that Magento 2 is installed, you can have a go with it. Feel free to resize your browser-width a bit to see whether the layout is actually responsive, login to the backend and navigate through the much cleaner interface or boot up your IDE and observe the new code base.

If you are interested in learning more about Magento 2, be sure to follow us on Twitter to get notified about the newest articles.

Subscribe Newsletter

Subscribe to get latest Magento news

40% Off for 4 Months on Magento Hosting + 30 Free Migration