MageQuest Logo
MageQuest Logo

Install & Setup

February 19, 2020
Getting started

This article covers the concepts of installing Magento 2 via the different options available, including our recommendations.

The 'Walkthru' tab will provide the actual guidance (mainly links to official resources) of how to get setup.

Before we begin

Before we look at how to install Magento 2, you're going to need a development environment. We're not going to provide in-depth details or support on how to set up and configure a local environment; this is best provided by the author of the environment in their documentation or by other pre-existing setup guides.

High-level system requirements

Below are the key technologies Magento 2 needs to run:

  • Webserver - Apache or NGINX
  • PHP - use the latest version of PHP 7 supported by the version of Magento 2 you're installing, while older versions do support PHP 5.6, using unsupported and insecure PHP versions is not recommended, nor are they particularly performant
  • Database - MySQL (or variants such as MariaDB or Percona)
System requirements

See full list of requirements on Magento DevDocs.

There's more than one way to get Magento 2

There are 3 main ways to install Magento 2:

  1. Downloading the source code as a compressed file and extract
  2. Using composer
  3. Cloning from GitHub

For the majority of your interactions with Magento 2 (including working with examples/challenges on MageQuest), we recommend installing via composer as it is the preferred method of getting the software and puts you in full control, including whether you want to exclude or add specific packages.

Cloning from GitHub is only suitable if you want to contribute code back to the core Magento codebase (i.e. make changes and open a pull request).

The first option, in reality, does little more than skip over the initial composer setup, however, if you want to get up and running initially with this method we won't judge!

Again, we're not covering how to action this process, here, but some guidance is provided in the 'Walkthru' tab.

Use composer

Essentially, if you're ever likely to be managing a Magento 2 instance in a production environment, you should be managing the software (e.g. updates, new extension or theme installs) using composer. Therefore it is recommended to get acquainted with this install method.

For more details, see Magento DevDocs.

Ways of installing Magento 2

Once you've got Magento 2 downloaded to your local environment and ensured all composer dependencies are installed, it's time to install the Magento 2 software, and there are 2 ways to achieve this:

  • Via the Web Setup Wizard (using a browser)
  • Via the CLI (Command Line Interface)

The setup wizard is by far the most straightforward and most user-friendly way to install Magento 2 (even for a hardened CLI user). It can be accessed by visiting the following page 'https://{your-magento-domain}/setup' where {your-magento-domain} is the domain of your local environment (this is configured/set based on the development environment you are utilising).

The CLI install method is excellent if you know exactly the configuration you want to set up front, but it is cumbersome to type out each value within the terminal and prone to error. It's real benefit/use case is for automating the install process (e.g. for a continuous development pipeline).

How about some products?

A default install of Magento 2 contains no additional configuration or catalog(ue) data (products/categories) of any type.

For a real Magento project, the merchant would provide the products they need for their store.

However, to learn Magento 2, it's relatively vital to have some data to work with to develop specific areas of the site.

Thankfully Magento provides a sample data pack, which can be installed via the bin/magento CLI tool (see the 'Walkthru' tab for details).

Wrap Up

  • Magento 2 key system requirements include a web server (Apache or NGINX), PHP and MySQL (or variant)
  • Magento 2 can be obtained via composer, downloading the source files or cloning from GitHub
  • Getting Magento 2 via composer is recommended in most scenarios, except when contributing to the core, where cloning from GitHub is required
  • Once downloaded, Magento 2 can be installed using the Web Setup Wizard or via the CLI tool
  • For development/demo purposes, optional sample data can also be installed
That's the end of this tale! Follow the Walkthru to put what you've learnt into practice