Home

Awesome

Magento2 Vagrant Box

A simple way to get magento2 up and running. It consists of a Debian Wheezy box provised via Puppet. The provider is Virtual Box. It will install apache2 +fastcgi, php, php-fpm, mysql and any other necessary dependancies.

The Magento 2 repository is a git submodule and can be edited/explored from the host machine. It is accessed by the guest via shared directories.

Usage

Installation

  1. Clone this repository: git clone --recursive https://github.com/rgranadino/mage2_vagrant.git
  2. Navigate into the repository via cd
  3. IMPORTANT: If you cloned the repository without the --recursive param, you need to initialize the required submodules: git submodule update --init --recursive
  4. Start up virtual machine: vagrant up
  5. Point a host name to 192.168.56.10 in /etc/hosts echo '192.168.56.10 mage2.dev' >> /etc/hosts

NOTE: Some composer dependancies require git. Agent Forwarding over SSH is enabled in the Vagrant file but you must have ssh-agent running and your key added. Running ssh-add should add the default key to the identities list, which presumably is the same key used to access github/bitbucket. You'll may also need to create a API access token in github, instructions can be found here:

  1. Once the machine completes provisioning, SSH to the server (vagrant ssh).
  2. Add your Magento Connect authentication credentials to the global composer auth.json:
{
    "http-basic": {
        "repo.magento.com": {
            "username": "<public key>",
            "password": "<private key>"
        }
    }
}
  1. Install Magento 2 by running:

Updating

  1. From the host machine run git pull && git submodule update --init && vagrant provision.
  1. If you want to start from a clean slate run: reinstall from within the guest machine. This will uninstall the application and reinstall it from scratch.

Shell Aliases / Scripts

Status and Debug utilities

A status vhost on port 88 has been setup to view apache's server status, php-fpm status as well as some other utilities.

Magento Admin User

Database Info

SSH Info

It's also possible to use vagrant ssh from within the project directory

File Structure

Host Machine / Project directory

Guest Machine