Getting Started

Last Updated: 2019-01-29

The fastest way to get started is to use one of the Project Templates available. If you want to read more about this, please go to Project Templates.

Installing From NuGet

All libraries and components for Piranha is available on NuGet. You can read more about all of the available core packages here.

Installing From GitHub

If you want the latest source code and maybe be a part of the community and contribute to Piranha you should head over to GitHub. You can read more about this here.

Project Setup

Configure the services

When configuring the services you should register of the Piranha modules you want to use. As an example, let's look at the service configuration for a project that uses SQLite and Piranha.AspNetCore.Identity.SQLite.

public void ConfigureServices(IServiceCollection services) 
services.AddMvc(config =>
new Piranha.Manager.Binders.AbstractModelBinderProvider());

services.AddPiranhaEF(options =>
services.AddPiranhaIdentityWithSeed<IdentitySQLiteDb>(options =>

Configure the application

Once the services has been configure you initialize the Piranha CMS application. Let's again look at how it's done in the example project. Please note that generic AspNetCore setup has been omitted.

public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApi api) 

// Initialize Piranha

// Build page types
var pageTypeBuilder = new Piranha.AttributeBuilder.PageTypeBuilder(api)

// Register middleware
app.UseMvc(routes =>


The important part here is the order in which middleware is registered. The current security component should always be registered before the rest of the Piranha middleware, and the rest of the Piranha middleware should be registered before MVC. This is needed as the middleware re-writes the request and passes it on to the correct MVC route that should handle it.