---
title: "Add a runtime plugin manually"
slug: "add-a-runtime-plugin-manually"
abstract: "How to install a plugin including how to create an environment folder and a plugin folder, and how to unpack the plugin data from a Nuget package."
---
# Add a runtime plugin manually

Plugins are distributed as Nuget packages. To add a plugin to a host application so that it is loaded at runtime, the plugin must be unpacked and have its assets copied to the correct locations.

The examples below show you how to install a plugin called `MyPlugin`:

- [Create an environment folder](https://doc.sitecore.com/xp/en/developers/102/sitecore-experience-manager/add-a-runtime-plugin-manually.html#UUID-3c998746-f995-59e2-eb5a-5a002aaed2ec_section-idm45495722118672 "Create an environment folder")
- [Create a plugin folder](https://doc.sitecore.com/xp/en/developers/102/sitecore-experience-manager/add-a-runtime-plugin-manually.html#UUID-3c998746-f995-59e2-eb5a-5a002aaed2ec_section-idm45679423143392 "Create a plugin folder")
- [Unpack plugin data from a Nuget package](https://doc.sitecore.com/xp/en/developers/102/sitecore-experience-manager/add-a-runtime-plugin-manually.html#UUID-3c998746-f995-59e2-eb5a-5a002aaed2ec_section-idm45363803631184 "Unpack plugin data from a Nuget package")

<details>
<summary><h2>Create an environment folder</h2></summary>

If you do not have one already, you need to create an environment folder under the `sitecoreruntime` folder. A Sitecore Host application will default its environment to Production. Unless a different environment is supplied at startup (via the --env command) it will look for the production folder first:

```

SitecoreHostApp
└── sitecoreruntime/
    └── <env>/

```

For example:  `hostapp/sitecoreruntime/production`

You can create any number of environment folders that contain different collections of plugins but only one environment can be loaded at a time by a Sitecore Host application.

</details>

<details>
<summary><h2>Create a plugin folder</h2></summary>

You need to create a folder for the plugin. This is where the plugin manifest, assets and configuration are located. This is located inside the `sitecore` folder, which is inside an individual environment folder.

```

SitecoreHostApp
└── sitecoreruntime/
    └── <env>/
        └── sitecore/
            └── MyPlugin/
       ├── sitecore.plugin.manifest
                ├── content/
                └── config/

```

The `sitecoreruntime/<env>/sitecore` folder does not override files in the hosts `sitecore` folder. This is a unique folder used for loading plugin assets.

Runtime environment folders cannot contain a `sitecoreruntime` folder of their own.

</details>

<details>
<summary><h2>Unpack plugin data from a Nuget package</h2></summary>

Assuming you have a Nuget plugin package called `MyPlugin.1.0.0.nupkg`:

1. Download and unpack the plugin contents.

    > [!note]
    > A Sitecore Host plugin contains a special `sitecore` directory in the root of the `nupkg` package with additional things inside it. Everything else is the standard Nuget structure.

2. Copy the contents of the Nuget `sitecore` folder to the plugin folder you created previously (for example, ` sitecoreruntime/production/sitecore/myplugin`).
3. If the plugin package contains a lib folder, copy the assets from the correct [target framework](https://docs.microsoft.com/en-us/nuget/create-packages/supporting-multiple-target-frameworks#framework-version-folder-structure) to the root of the `sitecoreruntime/<env>` folder (for example, `sitecoreruntime/production/*.dll`).
4. Add any additional assemblies that may be required by the plugin from other packages it depends on from Nuget in the same way.

The final structure should be similar to this:

```

SitecoreHostApp
└── sitecoreruntime/
    └── <env>/
        ├── *.dll
        └── sitecore/
            └── MyPlugin/
                ├── sitecore.plugin.manifest
                ├── content/
                └── config/

```

</details>