---
title: Configuring AdminUI
---

AdminUI configuration is set using environment variables and appsettings.json. The structure of AdminUIs settings is defined in [AdminUI Settings](./AdminUI_Settings.md).

### Configuring via Environment Variables

Environment variables may be set in many different way depending on you deployment strategy, this could be via any cloud hosting platform, docker compose files, etc... Examples of this can be

Note: Environments variables are nested with either __ (Linux environments) or : (Windows environments). E.g: `DataProtection__Persistence__Type` **or** `DataProtection:Persistence:Type`

## Running AdminUI On a Different Port
If you need to configure the ports for the website you can add the following section to your appsettings.json file:

```
  "Kestrel": {
    "Endpoints": {
      "Http": {
        //Your new Url Here
        "Url": "http://localhost:5020"
      }
    }
  }
```
If you would like to see all possible config options for the Kestrel property you can find them [here](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/endpoints?view=aspnetcore-5.0&viewFallbackFrom=aspnetcore-3.1#replace-the-default-certificate-from-configuration).

## Running AdminUI On a Different Path
If you are not running AdminUI from the root URL (e.g., using a path like https://generalweb/myadminui), an additional step is required. This is necessary because the index.html file, from which the SPA starts running, has a default reference to the root of the URL:
```
<base href="/">
```
This refers to an HTML path, so adding a full stop before the slash will not work in all the cases. Instead, you need to update the href with the AdminUI path. The specific steps for this vary depending on how you deploy AdminUI:

### Using Nuget package
You need to include the `AdminUiPath` property in your csproj file. This property will overwrite the base href after building the index.html file. Using the example mentioned earlier (https://generalweb/myadminui), the configuration would follow this schema:
```
<Project>
  <PropertyGroup>
	  <AdminUiPath>/myadminui/</AdminUiPath>
  </PropertyGroup>
</Project>
```
Remember to include a slash at the end of the path.
This has to be done from the csproj (build pipeline) as the Nuget AdminUI will replace the html files on build.

### Using Zips or installer
In this case, manually change the path in the index.html file located in the wwwroot folder of your AdminUI. Do not confuse it with the parent wwwroot that holds the AdminUI folder and other apps. Following the example (https://generalweb/myadminui), the updated line should be:
```
<base href="/myadminui/">
```
Remember to include a slash at the end of the path.

### Using Docker
In the AdminUI Dockerfile, include the following command changing "myadminui" with your own path:
```
sed -i 's/<base href="\/">/<base href="\/myadminui\/">/' /wwwroot/admin/index.html
```
This has to be done from Docker as the Nuget AdminUI will replace the html files on build.
Remember to include a slash at the end of the path. Also, notice the forward slashes are escaped with a backslash.

## Example appsettings.json:

Below is an example of what your appsettings.json may look like with the minimal required settings to get AdminUI running. If you require further configuration we have a [detailed list](./AdminUI_Settings.md) of configuration settings.

```language-json
{
  "UiUrl": "http://localhost:5000",
  "AuthorityUrl": "https://localhost:5003",
  
  "AdminUIClientSecret": "dev",
  
  "DbProvider": "SqlServer",
  "IdentityConnectionString": "Server=localhost;User Id=AdminUI;Password=Password123!;Database=IdentityExpressDb;",
  "IdentityServerConnectionString": "Server=localhost;User Id=AdminUI;Password=Password123!;Database=IdentityExpressDb;",
  
  "LicenseKey": "*** Enter License Key Here ***"
}
```