Installing Magento2 on MageStack

During an AMA on Reddit, I was asked for some thoughts on Magento2 - which did get me curious about just exactly what was required for Magento2 to run on MageStack.

Historically, its worked out of the box, with nothing special required, so its interesting to see what the latest release requires.

Changing MageStack to Magento2 mode

The only change required is that the stack defaults are changed from M1 to M2, so I quickly edited the vhost template to reflect the new release (customers should ask for this change),


Then that's it. The stack is now M2 ready, so on to the installation.

Installing Magento2

As www-data, change directory to the vhost for install,

cd /microcloud/domains/example/domains/

Then check out the latest copy of Magento2 (I'm chose to stick with the develop branch)

git clone .

Install composer for the given domain, example www

Take note of the composer command name and use it to then run the install process,

source ~/.bash_profile
cm_examplecom install

Magento 2 will throw an error message if /tmp/session is missing, so create this,

mkdir /tmp/session

Then start the installer via command line (I've already created a DB and user),

php-5.6 bin/magento setup:install \
  --db-host=db1.i \
  --db-name=example_m2 \
  --db-user=example_m2 \
  --db-password=x \
  --admin-user=admin \
  --admin-password=x \ \
  --admin-firstname=Sonassi \
  --admin-lastname=Sonassi \

After a few seconds, Magento is installed and that's pretty much it.