Installation

Add the admin panel to an ASP.NET Core app

StellarAdmin goes into an app you already have. Any ASP.NET Core app on .NET 10 or later will do, whether it uses MVC, Razor Pages or minimal APIs.

Install the packages

Add StellarAdmin, and StellarAdmin.EntityFrameworkCore if your data lives in EF Core.

dotnet add package StellarAdmin
dotnet add package StellarAdmin.EntityFrameworkCore

There's no need to install StellarAdmin.UI as well. It comes along with StellarAdmin.

Register the panel

In Program.cs, call AddStellarAdmin. This is where your resources go later, along with things like authorization and branding. It registers MVC for you, so you don't have to add that yourself.

using StellarAdmin;

builder.Services.AddStellarAdmin(admin =>
{
    // Resources, authorization and branding go here
});

Map the panel

Next, map the panel with MapStellarAdmin. The panel's CSS and JavaScript are static assets, so make sure you're serving those too, or you'll get a page of unstyled HTML.

var app = builder.Build();

app.UseRouting();
app.UseAuthorization();

app.MapStaticAssets();
app.MapStellarAdmin();
app.MapRazorPages();

app.Run();

It doesn't matter whether MapStellarAdmin comes before or after your own endpoints.

Open the panel

Run your app and head to /stellaradmin. There's not much to see yet, because you haven't added any resources. In Development you'll also get a checklist of what's left to set up.

Serving it from another path

The panel lives at /stellaradmin by default. To put it somewhere else, pass the path to MapStellarAdmin:

app.MapStellarAdmin("/admin");

Before you go live

Out of the box, anyone who can reach your app can open the panel. Lock it down before you deploy:

builder.Services.AddStellarAdmin(admin =>
{
    admin.RequireAuthorization(policy => policy.RequireRole("Staff"));
});

This only lets in users with the Staff role. See authorization for the other options.

Where to next

Now add your first resources. If something isn't working, have a look at installation issues.

On this page