Snippet to programmatically set the frontpage

\Drupal::configFactory()
      ->getEditable('system.site')
      ->set('page.front', '/home')
      ->save();

 

 

 

Saved you some valuable time?

Received 100 so far from 4 kind contributors.