It's possible to bootstrap Drupal 8 and create a new node using [answer # 174474][1].

    define('DRUPAL_DIR', '/usr/share/nginx/html');
    use Drupal\Core\DrupalKernel;
    use Symfony\Component\HttpFoundation\Request;

    require_once DRUPAL_DIR . '/core/includes/database.inc';
    require_once DRUPAL_DIR . '/core/includes/schema.inc';

    // Specify relative path to the drupal root.
    $autoloader = require_once DRUPAL_DIR . '/autoload.php';
    $request = Request::createFromGlobals();

    // Bootstrap drupal to different levels
    $kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod');
    $kernel->boot();
    $kernel->prepareLegacyRequest($request);
    $em = $kernel->getContainer()->get('entity.manager');

    $entity = $em->getStorage('node')->create(
        array(
          'type' => "article",
          'title'=> "test entity",
          'body' => "body body body",
        ));


    $entity->save();


Is it possible to bootstrap a subsite database when using [multisite][2] to create the new node in a specific subsite?

In Drupal 7, [this can be done][3] by using the function drupal_override_server_variables, but this function doesn't exist in Drupal 8. 

I also tried modifying the $_SERVER['HTTP_HOST'] and $_SERVER['SCRIPT_NAME'] variables [according to this forum post][4], with no luck. 


  [1]: https://drupal.stackexchange.com/questions/174474/bootstrap-from-external-script
  [2]: https://www.drupal.org/docs/7/multisite-drupal/multi-site-sharing-the-same-code-base
  [3]: https://www.drupal.org/forum/support/post-installation/2013-09-03/drupal-bootstrap-on-multi-site-d7
  [4]: https://www.drupal.org/forum/support/post-installation/2010-01-14/drupal-bootstrap-on-multi-site