Create new menu with a module
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();
}