How to create a new Tag group and save it? I'm new to the Craft CMS framework and have a question about tags. How can I create a new tag group?
You can create a tag list by hand via the admin panel &gt; settings &gt; Tag Groups &gt; New Tag Group.
This is a way I can't use for plug-in development. So far as I know, I have to use the following code:
    $tagGroup = new TagGroup();
    $tagGroup-&gt;name = 'GroupName';
    $tagGroup-&gt;handle = 'GroupHandle';
You were on the right track. To save things in Craft, you need to use the according service. In your case you need the tags service:
$tagGroup = new TagGroup();
$tagGroup-&gt;name = 'GroupName';
$tagGroup-&gt;handle = 'GroupHandle';
$isTagGroupSaved = Craft::$app-&gt;getTags()-&gt;saveTagGroup($tagGroup);

if(!$isTagGroupSaved) {
    // Inspect validation errors if saving the tag group failed
    var_dump($tagGroup-&gt;getErrors());
}