# Plugins development

Strapi allows you to create local plugins that work exactly like the external ones installed with npm or through the Marketplace.

🤓 Extending plugins

If you would rather extend an existing plugin than create a new one, see the Plugins extension documentation.

# Creating a plugin

To create a plugin, use Strapi CLI tools:

  1. (Optional) If you don't already have an existing project, create a new development project with strapi new myDevelopmentProject.
  2. Start the project with cd myDevelopmentProject && strapi develop.
  3. In a new terminal window, run cd /path/to/myDevelopmentProject && strapi generate to launch the interactive strapi generate CLI.
  4. Choose "plugin" from the list, press Enter, and give the plugin a name.
  5. Enable the plugin by adding it to the plugins configurations file:
    // path: /path/to/myDevelopmentProject/config/plugins.js
    
    module.exports = {
      // ...
      'my-plugin': {
        enabled: true,
        resolve: './src/plugins/my-plugin' // path to plugin folder
      },
      // ...
    }
    
  6. Run strapi build to build the plugin.

Plugins created this way are located in the plugins folder of the application (see project structure).

# Adding features to a plugin

Strapi provides programmatic APIs for your plugin to hook into some of Strapi's features.

Plugins can register with the server and/or the admin panel, by looking for entry point files at the root of the package: