How to insatall new theme on magento2

To setup a new theme on localhost is a easy step on magento2.
You can also see how to install magento2 on localhost

Step1:- Go to magento root directory folder and create 2 folder on inside it.

<MAGENTO2 ROOT DIRECTORY PATH>/app/design/frontend/<Vendorname>/<themename>

Here i am create a new theme with VENDOR-NAME = Csttheme
THEME-NAME = newtheme
Please take care small and captial letter.

My new theme path is below.

/app/design/frontend/Csttheme/newtheme

Step2: Create a theme.xml file inside theme folder and put below content on that file.

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Newtheme</title>
    <parent>Magento/blank</parent> <!-- parent theme name -->
    <media>
        <preview_image>media/preview.jpg</preview_image>
    </media>
</theme>

Step3: Now register your new theme on magento2.
Create a registration.php file and below content on that file.

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Newtheme</title>
    <parent>Magento/blank</parent> <!-- parent theme name -->
    <media>
        <preview_image>media/preview.jpg</preview_image>
    </media>
</theme>

Step4: Copy the media folder on the location

 <Magento root folder path>/vendor/magento/theme-frontend-luma/media

and put that folder on inside new theme.

<Magento root folder path>/app/design/frontend/Csttheme/newtheme/

Step5: Now set your new theme on Backend

 Content >> Configuration >> Edit "Main Website Store" and than select "Applied Theme" dropdown to your new theme.

Step6: Clear your folder cache inside var on root

<Magento root folder path>/var/

Step7: Refresh your url on your browser and see the blank theme will be dispaly.
For more clarification you can also chek view source of the page.

Unable to enable modules because of the following constraints on magento2

I have faced this problem when i was setup new magento2
on local machine, and i have tried to many process to
solve this issue but nothing work.

Simply this is caching issue. The browser which I was
used it. They have save js with my previous installation.

Step1: Use different browser and than check.

OR

Step2
Clear browser cache and than check.

How to Install magento2 on localhost using GIT

we can download magento2 in 3 ways.
1) Direct Download
2) Using COMPOSER
3) Using GIT

Step1: go to your root folder and check git install on
your local machine or not. type below command on console.

git

If not than install it.

apt -get install git

Step2: get a git clone on the root directory.

git clone https://github.com/magento/magento2.git

Step3: Give the permission of the folder

sudo chmod -R 777 YOUR-PROJET-FOLDER-NAME/

Step4: After that put below url on your local browser.


http://localhost/YOUR-PROJET-FOLDER-NAME/

how to install magento2 on localhost using Composer

we can download magento2 in 3 ways.
1) Direct Download
2) Using COMPOSER
3) Using GIT

Step1: First you need to check composer install on system or not.
Type below command on your console to check composer installation

	composer -help

If not install than install it . using below command.

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

The first command install Composer into your local directory,
the second will move the composer.phar file to a directory
where it can be accessed globally by your system.

Again check below command

 composer -help

Step 2: Install magento project on local machine, Type command on console.

composer create-project magento/project-community-edition magentodemo

  
root@system:/var/www/html# composer composer create-project magento/project-community-edition magentodemo

you see below output on your console

Installing magento/project-community-edition (2.0.2)
  - Installing magento/project-community-edition (2.0.2)
    Downloading: 100%         

Created project in Magento
Loading composer repositories with package information
    Authentication required (repo.magento.com):       
      Username: bfba1bb4bdfdcb63d8458457728f
      Password: 
Do you want to store credentials for repo.magento.com in /home/gaurav/.composer/auth.json ? [Yn] Y

Step3: After this you need username and password

 

https://www.magentocommerce.com/

and login into your account and than go to Develoers >> Secure Keys and generate key here.
Basically public key is belong to Username
Private key is belong to Password

Step4: Give the permission of the folder

sudo chmod -R 777 magentodemo/

Step5: After that put below url on your local browser.


http://localhost/magentodemo/

If you want to add sample data on your project than run
below command on console after complete install project.

php <your Magento install dir>/bin/magento sampledata:deploy

Install Magento2 on localhost

we can download magento2 in 3 ways.
1) Direct Download
2) Using COMPOSER
3) Using GIT

Before install magento2 on localhost, we need to check is our server
fulfill the Magento2 system requirement or not. Check the below link.


http://devdocs.magento.com/guides/v2.1/install-gde/system-requirements-tech.html

<strong>Using Window/Linux operating System without composer:-</strong>

Step1: Download magento from magento website using below url.

https://magento.com/tech-resources/download

Put that zip folder to your root path (/var/www/html/) and unzip it.

Step2: Rename the folder name as per your project name and give the 777 permission of that folder.

Step3: create a db on your local machine.

Step4: Run that url on your local browser
http://localhost/YOURPOJETCNAME/setup/ (On step 2 folder name)

Step5: Now follow your browser steps and install magento2 latest version on your local machine.

NOTE:- If you are installing first time Magento2 on your localhost. I suggest don’t
use composer due to chceck magento2 system requirment either compatible or not.