How to register a theme in Magento 2

Creating a custom theme in Magento 2 involves a process of registering your theme. In this post we will describe how to do it. All the awesome theme customizations are up to you.

Creating a new theme is similar to creating an extension in Magento 2.

First of all, let’s create a registration.php :

 * Location app/design/frontend/Atwix/custom/registration.php
 * @author Atwix Team
 * @copyright Copyright (c) 2016 Atwix (
 * @package Atwix_Customtheme


Next, we will need to add an app/design/frontend/Atwix/custom/composer.json :

  "name": "atwix/theme-frontend-custom",
  "description": "N/A",
  "require": {
    "php": "~5.6.5|7.0.2|7.0.4|~7.0.6",
    "magento/framework": "100.1.*"
  "type": "magento2-theme",
  "version": "100.1.1",
  "license": [
  "autoload": {
    "files": [

Instead of the module.xml we will need a theme.xml, which will define the theme name and the dependency from the other theme:

<?xml version="1.0"?>
 * Location app/design/frontend/Atwix/custom/theme.xml
 * @author Atwix Team
 * @copyright Copyright (c) 2016 Atwix (
 * @package Atwix_Customtheme

<theme xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Atwix Custom</title>

Don’t forget to flush cache running the corresponding command from Magento 2 installation root directory:

bin/magento cache:flush

That’s all! Now, we are able to see our theme in the “Content > Themes”.


This code was tested on Magento 2.0.10 and 2.1.2 versions.

You may also want to read:

  • Magento 2 system configuration
  • Case Studies

    Meet our clients

    From startups backed by Mark Cuban and Sir Richard Branson, to some of the biggest eCommerce operations in the world, Atwix helps our clients deliver unparalleled eСommerce experiences. We’re proud to work with the following companies: