How do I put a  around a form?
There are many different ways to add markup to a form in Drupal 8.  In your build array, you could add a wrapper element, and then nest the form within:

$build['wrapper'] = [
  '#type' =&gt; 'container',
  '#attributes' =&gt; ['id' =&gt; 'my-form-wrapper', 'class' =&gt; ['my-form-wrapper']],
];

$build['wrapper']['form'] = \Drupal::formBuilder()-&gt;getForm('Drupal\mymodule\Form\MyForm');


Alternately you could add a '#prefix' and a '#suffix' to your form.

$form['#prefix'] = '&lt;div class="my-form-wrapper"&gt;';
$form['#suffix'] = '&lt;/div&gt;';


Or you could use a template for your form and add it to your theme, using the suggestion form--form-id.html.twig and add custom markup there.  (Be sure to replace underscores with hyphens in the template name.)

&lt;div id="my-form-wrapper"&gt;
  &lt;form{{ attributes }}&gt;
    {{ children }}
  &lt;/form&gt;
&lt;/dv&gt;