---
title: "How to Create System.xml Configuration in Magento 2"
url: "https://magecomp.com/blog/create-system-xml-configuration-magento-2/"
date: "2017-06-22T17:50:55+00:00"
modified: "2025-02-22T07:21:00+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 618
reading_time: "4 min read"
summary: "At the time of creating new extension in Magento 2, you need to provide admin user with some settings prior to make it work. System.xml is a configuration file which is used to create those setting..."
description: "Learn how to create System.xml Configuration for your next Magento 2 extension. Step by step guide to follow."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How to Get User Information Inside of Controller in Magento 2"
    url: "https://magecomp.com/blog/get-user-information-inside-of-controller-magento-2/"
  - title: "Magento 2: How to Get Custom Column Value of Order using GraphQL"
    url: "https://magecomp.com/blog/magento-2-get-custom-column-value-of-order-using-graphql/"
  - title: "Magento 2: How to Get All Downloadable Links Details from the Downloadable Product Programmatically"
    url: "https://magecomp.com/blog/magento-2-get-all-downloadable-links-details-from-the-downloadable-product-programmatically/"
---

# How to Create System.xml Configuration in Magento 2

_Published: June 22, 2017_  
_Author: Dhiren Vasoya_  

![How to Create System.xml Configuration in Magento 2](https://magecomp.com/blog/wp-content/uploads/2017/06/How-to-Create-System.xml-Configuration-in-Magento-2-1024x332.webp)

At the time of creating new extension in Magento 2, you need to provide admin user with some settings prior to make it work. System.xml is a configuration file which is used to create those setting fields in extension and it is placed under “etc” folder. After the successful creation of settings, these fields are shown under Store –> Configuration –> Your Extension.

Here, we will learn to create system.xml configuration in Magento 2.

[![Magento Malware Removal](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-Malware-Removal-CTA-2.webp)](https://magecomp.com/magento-malware-removal.html)

Go to **app/code/Magecomp/Hello/etc/adminhtml/system.xml** and add the code below:

```

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="helloworld" translate="label" sortOrder="100">
            <!-- add a new tab with id helloworld -->
            <label>Hello World</label>
        </tab>
                    <!-- add a new section with id helloworld and for tab helloworld -->
            <class>separator-top</class>
            <label>Hello World Configuration</label>
            <tab>helloworld</tab>
            <resource>Magecomp_First::test_config</resource>
            <group id="active_display" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                <!-- add a new group with id active display -->
                <label>Hello World Configuration Options</label>
                <field id="scope" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                    <!-- add a new field with id scope -->
                    <label>Enable Helloworld Controller</label>
                    <source_model>MagentoConfigModelConfigSourceYesno</source_model>
                </field>
            </group>
            </system>
</config>
```

[![Magento 2 Speed & Performance Optimization Services](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Speed-Performance-Optimization-Services-CTA-3.webp)](https://magecomp.com/magento-performance-optimization.html)

With above code, we can add new tab, section, group and field. Now the next step is to set default values for these configuration item, create the file **app/code/Magecomp/Hello/etc/config.xml** and add the code below:

```

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <helloworld>
            <active_display>
                <scope>1</scope>
            </active_display>
        </helloworld>
    </default>
</config>
```

There is another important thing to do is to setup ACL. In our system.xml, we have the line
Magecomp_First::test_config
This is used to setup ACL for system configuration. Create a file app/code/Magecomp/Hello/etc/acl.xml with below code:

```

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Adminhtml::admin">
                <resource id="Magento_Adminhtml::stores">
                    <resource id="Magento_Adminhtml::stores_settings">
                        <resource id="Magento_Adminhtml::config">
                            <resource id="Magecomp_First::test_config" title="Hello World Section" />
                        </resource>
                    </resource>
                </resource>
            </resource>
        </resources>
    </acl>
</config>
```

Now open Magento admin and you can see the HelloWorld tab and sections.

Hope this tutorial has helped you to create system.xml configuration for your next Magento 2 extension.

[![hyva theme development](https://magecomp.com/blog/wp-content/uploads/2025/02/hyva-theme-development-CTA-1.webp)](https://magecomp.com/services/hyva-theme-development/)

Let me know if you stuck somewhere or require any help regarding through commenting. I will be happy to help you.


---

_View the original post at: [https://magecomp.com/blog/create-system-xml-configuration-magento-2/](https://magecomp.com/blog/create-system-xml-configuration-magento-2/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-08-20 06:00:04 UTC_  
