diff --git a/gridstack.install b/gridstack.install
new file mode 100644
index 0000000..f8e012a
--- /dev/null
+++ b/gridstack.install
@@ -0,0 +1,77 @@
+<?php
+
+/**
+ * @file
+ * Installation actions for GridStack.
+ */
+
+use Symfony\Component\Yaml\Yaml;
+
+/**
+ * Implements hook_requirements().
+ */
+function gridstack_requirements($phase) {
+  if ($phase != 'runtime') {
+    return [];
+  }
+
+  if (function_exists('libraries_get_path')) {
+    $path = libraries_get_path('gridstack') . '/dist/gridstack.min.js';
+  }
+  else {
+    $path = DRUPAL_ROOT . '/libraries/gridstack/dist/gridstack.min.js';
+  }
+
+  $exists = is_file($path);
+
+  return [
+    'gridstack_library' => [
+      'title'       => t('GridStack library'),
+      'description' => $exists ? '' : t('The <a href=":url">GridStack library</a> should be installed at <strong>/libraries/gridstack/dist/gridstack.min.js</strong>, or any path supported by libraries.module if installed.', [':url' => 'https://github.com/troolee/gridstack.js']),
+      'severity'    => $exists ? REQUIREMENT_OK : REQUIREMENT_ERROR,
+      'value'       => $exists ? t('Installed') : t('Not installed'),
+    ],
+  ];
+}
+
+/**
+ * Update config settings, and optionsets.
+ */
+function gridstack_update_8101() {
+  /** @var \Drupal\Core\Config\ConfigFactoryInterface $config */
+  $config = \Drupal::service('config.factory');
+
+  // Remove deprecated jQuery UI option as per v0.3.0.
+  $config->getEditable('gridstack.settings')->clear('jquery_ui')->save();
+
+   // Clear the caches.
+  \Drupal::entityTypeManager()->clearCachedDefinitions();
+
+  // Cleanup unused options.
+  $config_factory = \Drupal::configFactory();
+  foreach ($config_factory->listAll('gridstack.optionset.') as $optionset_name) {
+    $optionset = $config_factory->getEditable($optionset_name);
+
+    // Remove options.settings.framework for options.use_framework.
+    $optionset->clear('options.settings.framework');
+
+    // Loop through each grid.
+    $grids = $optionset->get('options.grids');
+    foreach ($grids as $key => $grid) {
+
+      // Remove unused empty nested options.
+      if (isset($grid['nested']) && empty($grid['nested'])) {
+        $optionset->clear('options.grids.' . $key . '.nested');
+      }
+    }
+
+    $optionset->save(TRUE);
+  }
+
+  // Import new optionsets.
+  foreach (['bootstrap', 'foundation'] as $key) {
+    $config_path = drupal_get_path('module', 'gridstack') . '/config/install/gridstack.optionset.' . $key . '.yml';
+    $data = Yaml::parse($config_path);
+    $config_factory->getEditable('gridstack.optionset.' . $key)->setData($data)->save(TRUE);
+  }
+}
