Part 2: Installing Piranha CMS Locally

7/14/2021 in tutorials

#dotnet #azure #piranha-cms #cms #piranha #tutorial

This post is part 2 in the series Deploying Piranha CMS to Azure.

Piranha CMS is an open-source .NET 5 CMS designed by developers for developers. This means that Piranha can be setup locally by installing the official templates and using the standard dotnet new command.

Installing Piranha CMS

To install Piranha CMS templates, run the following command in a terminal window:

dotnet new -i Piranha.Templates

After the Piranha templates have been installed, navigate to your repository location in the terminal by using the standard cd command:

cd ~/code/github/piranhacms

Next, you'll need to choose a Piranha template for your project. For my project, I chose to use the MVC template, but you can see the full list of Piranha templates by running the following command:

dotnet new | grep piranha

Once you've chosen the template you wish to use, you are ready to setup and configure your project. In this guide, I chose to use SQL Server as my database provider since I'm using an Azure SQL Server as my primary data store. I also chose to use Azure Blob Storage as my storage provider. To see all of the available database and storage options for Piranha, run the following command using the specific template you chose (here I'm using piranha.mvc):

dotnet new piranha.mvc --help

At this point, you are ready setup Piranha CMS by specifying the name, database and storage options, using the command below, then move on to Part 3: Configuring Piranha CMS for Azure.

dotnet new piranha.mvc -n PiranhaCms -d SQLServer -s BlobStorage

However, If you only want to setup Piranha CMS to run locally and do not intend to deploy to Azure, simply run the commands below to create a default Piranha installation and run it in your web browser.

dotnet new piranha.mvc

dotnet restore

dotnet run

Up next:

Part 3: Configuring Piranha CMS for Azure

In order to run a Piranha CMS instance on Azure, some configuration of your new site is necessary. These configuration changes include setting connection strings for Azure SQL Server and Azure Blob Storage. In order to correctly update your Piranha CMS co... Read more

#dotnet #azure #piranha-cms #cms #blob-storage #github #piranha #sql #tutorial #vscode #git