Create new menu with a module I want to create a new menu in Drupal 8 when I install my module. How can I achieve this?

I don't want to add a link to an existing menu, but create a new one.
You can either include the menu in your modules default configuration by adding a file to config/install folder of the module:

system.menu.menu-name.yml:

langcode: en
status: true
dependencies: {  }
id: menu-name
label: 'Menu label'
description: 'Menu description'
locked: false


You can also create the Menu entity, perhaps in the hook_install() hook.

use Drupal\system\Entity\Menu;

function MY_MODULE_install() {
  $menu = Menu::create([
    'id' =&gt; 'menu_id',
    'label' =&gt; 'Menu label',
  ])-&gt;save();
}