Magento 2: Install using Composer and Command Line (CLI)
1) Verify System Requirements : Before downlowding magento 2 and installing composer, check magento2 reqirements on : http://devdocs.magento.com/guides/v2.0/install-gde/system-requirements2.html
2) Install Composer : You need to have composer installed in your system. You can get composer from here http://getcomposer.org and need to follow the mentioned steps of installation.
You can install composer in Ubuntu Linux using the following command:
sudo apt-get install composer3) Download Magento using Composer : We will create a folder named magento2 and download Magento 2 over there. So, the full path for my magento 2 folder will be /var/www/html/magento2.
Using Composer, download Magento CE edition in your directory:
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition /var/www/html/magento2After running this command, it will ask for username and password for repo.magento.com.
Authentication required (repo.magento.com): Username: Password:To get the username and password for repo.magento.com, you have to generate access keys from https://marketplace.magento.com/customer/account/
- Go to https://marketplace.magento.com/customer/account/
- After you are logged in, click My Access Keys link
- On My Access Keys page, click on Generate Keys button
- Then, you will see two keys (Public and Private). Public Key will be your username and Private Key will be your password
4) Set proper file permissions : Set write permissions to vendor, app/etc, pub/static, pub/media, and var directories. You can set the permission to all of these folders with the following command:
cd /var/www/html/magento2 && find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \; && find var vendor pub/static pub/media app/etc -type d -exec chmod g+w {} \; && chmod u+x bin/magento5) Switch User : Switch to user which has write permission to your magento2 directory.
Go to your magento2 web root directory:
su your_system_user6) Install Magento 2 : Go to your magento2 web root directory:
cd /var/www/html/magento2
Specify the base url, database host, database user, database password, admin name, admin email, admin password, default currency, default timezone, etc
You may also need to give permissions to var and pub
sudo php bin/magento setup:install --base-url=http://domain.com/magento2/ \ --db-host=localhost --db-name=magento2 --db-user=root --db-password=root \ --admin-firstname=Magento --admin-lastname=User --admin-email=demo@yourmail.com \ --admin-user=admin --admin-password=admin123 --language=en_US \ --currency=USD --timezone=America/Chicago --use-rewrites=1You will get the success message after installing along with admin uri.
You may also need to give permissions to var and pub
sudo chmod -R 777 pub var
No comments:
Post a Comment