You can use the Magento integrator instructions to install download/install Magento 2 via composer
Get the Magento CE metapackage
To get started:
- If you haven’t done so already, get your authentication keys.
- Log in to your Magento server as, or switch to, the Magento file system owner.
- Change to the web server docroot directory, or to a directory you’ve configured as a virtual host docroot.
- Enter the following command:
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition <INSTALLATION_DIRECTORY>When prompted, enter your authentication keys. Your public key is your username; your private key is your password.
This command creates the project and downloads dependencies for it. The project is in a directory named if you provided the parameter or project-community-edition if you did not.
/usr/bin/env php ~/code/<CLIENT_CODE>/magento2/bin/magento setup:install --language='en_US' \
--db-host='localhost' \
--db-name='<CLIENT_CODE>_dev_magento2' \
--db-user='developer' \
--db-password='<DB_PASSWORD>' \
--base-url='http://<CLIENT_CODE>.dev/' \
--base-url-secure='https://<CLIENT_CODE>.dev/' \
--admin-user='augustash' \
--admin-password='<PASSWORD>' \
--admin-firstname='August' \
--admin-lastname='Ash' \
--admin-email='[email protected]'\
--timezone='America/Chicago' \
--use-rewrites='1' \
--use-secure='0' \
--use-secure-admin='0' \
--session-save='files' \
--backend-frontname='manage' \
--currency='USD'
$ n98-magerun2 deploy:mode:set developer
The below command will deploy assets for the following themes:
Magento/blank
Magento/luma
Magento/backend
$ n98-magerun2 setup:static-content:deploy
############################
##
## Magento 2 project crons
##
############################
# <CLIENT_CODE> Magento 2 Project
* * * * * /usr/local/bin/php /path/to/Magento_2_Root/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /path/to/Magento_2_Root/var/log/magento.cron.log
* * * * * /usr/local/bin/php /path/to/Magento_2_Root/update/cron.php >> /path/to/Magento_2_Root/var/log/update.cron.log
* * * * * /usr/local/bin/php /path/to/Magento_2_Root/bin/magento setup:cron:run >> /path/to/Magento_2_Root/var/log/setup.cron.log
You can refer to the sample files for reference of how this was setup on my MacOS Sierra laptop with nginx, percona-server, php56, php70, php71 and dnsmasq installed via homebrew.
- nginx-conf.d-magento2.conf (
/etc/nginx/conf.d/magento2.conf
) - nginx-vhost-example.conf (
/etc/nginx/sites-available/sandbox-magento2ce.conf
)