Magento2 – Theme Basics

In this blog post we will see how setup a new theme in magento2

Setting up a new theme is very easy in magento2. Theme name is magento is divided in two parts company name and actual theme name.e.g the pre existing themes like Magento_Luma or Magento_Blank.

If you used the “magento2-community-edition” repository to setup your magento2 then you will find theme files in “vendor/magento/theme-frontend-luma” . But if you used to the “magento2” repository existing theme are located in “app/design/frontend”


So to create your own theme go to folder app/design/frontend and make a new folder
Excellence (company name) and then first (theme name)
so your directory structure would be app/design/frontend/Excellence/first


Create a file name theme.xml inside your theme directory and add the following code

<theme xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
     <title>Excellence First</title> <!-- your theme's name -->
     <parent>Magento/blank</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
     <!-- <media>
     </media> -->  <!-- Here you can put a preview image of your theme. If you don't have a preview image comment it else it gives an error -->


Create a file name registration.php inside your theme directory



Step4 – Optional

Create a componser.json file and add the following code

    "name": "excellence/first",
    "description": "N/A",
    "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0",
        "magento/theme-frontend-blank": "100.0.*",
        "magento/framework": "100.0.*"
    "type": "magento2-theme",
    "version": "100.0.1",
    "license": [
    "autoload": {
        "files": [


At this stage, and empty theme should have been installed which can be seen in magento admin.
Stores -> General -> Design -> Design Theme

Your theme should be visible here

Troubleshooting: If you get any errors make sure all permissions are correct and you have followed the post installation blog