In this post I am going to explain how to Set Default Values for System Configuration Fields in Magento 2.

First we will make one “system.xml” file at below path.

Path: app/code/<vendor>/<module>/etc/adminhtml/system.xml

Now, we need to set default values for above system config fields.

For that add one file “config.xml” at below path.

Path: app/code/<vendor>/<module>/etc/config.xml

The path of the field is “section/grounp/field”.

Here our section is “mymodulesection”, group is “general” and fields are “enabled” and “welcome_text”.

This code will make default system config value when you install module.