For Windows, there is an installation option (unattended install), when all the options that need to be selected manually during the installation process itself in different menus can be specified as command line keys or as a settings file.
Since Ubuntu is now widely used on servers, a similar approach to installation is probably implemented for it. How it's done?