Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
We have made custom Umbraco templates that are available for use with dotnet new
. The steps below will demonstrate the minimum amount of actions required to get you going and set up an Umbraco project from the command line using .NET templates.
Install the latest .NET SDK.
Run dotnet new install Umbraco.Templates
to install the project templates.
The solution is packaged up into the NuGet package Umbraco.Templates and can be installed into the dotnet CLI.
Once that is complete, you can see that Umbraco was added to the list of available projects types by running
dotnet new --list
:
In some cases the templates may silently fail to install (usually this is an issue with NuGet sources). If this occurs you can try specifying the NuGet source in the command by running dotnet new install Umbraco.Templates --nuget-source "https://api.nuget.org/v3/index.json"
.
To get help on a project template with dotnet new
run the following command:
dotnet new umbraco -h
From that command's output, you will get a better understanding of what are the default template options, as well as those command-line flags specific to Umbraco that you can use (as seen below):
Create a new empty Umbraco solution using MS SQL Azure/Server:
dotnet new umbraco -n MyCustomUmbracoProject
You will now have a new project with the name MyCustomUmbracoProject, or the name you chose to use. The new project can be opened and run using your favorite IDE or you can continue using the CLI commands.
If you want to create a solution file as well you can run the commands below.
dotnet new sln
dotnet sln add MyCustomUmbracoProject
Navigate to the newly created project folder:
cd MyCustomUmbracoProject
Build and run the new Umbraco .Net Core project:
dotnet build
dotnet run
The project is now running on the Kestrel server and has assigned a free available port to run it on. Look in the terminal window after the dotnet run
command to see the URLs.
The next step is to run through the Umbraco CMS installation. If you chose to use MS SQL Server/Azure you will need to add your connection string during this setup process to get access to the Umbraco backoffice.
Instructions on installing Umbraco on various platforms using various tools.
The fastest way to get the latest version of Umbraco up and running is using the command line (CLI).
Open your command line.
Install the Umbraco templates:
Create a new project:
Navigate to the newly created project folder. It will be the folder containing the .csproj
file:
Build and run the newly created Umbraco site:
The console will output a message similar to: [10:57:39 INF] Now listening on: https://localhost:44388
Open your browser and navigate to that URL.
Follow the instructions to finish up the installation of Umbraco.
Members of the Umbraco Community have created a website that makes the installation of Umbraco a lot easier for you. You can find the website at https://psw.codeshare.co.uk. On the website, you can configure your options to generate the required script to run. Click on the Install Script tab to get the commands you need to paste into the terminal. This tab also includes the commands for adding a starter kit or unattended install which creates the database for you.
There are numerous ways to install Umbraco. Below, you can find links to different installation methods that will help you easily install and set up Umbraco projects.
.NET CLI, included with the .NET Software Development Kit (SDK), can be used to install or uninstall .NET templates from NuGet. This can be done by using the dotnet new
command on any OS. The underlying Template Engine enables the creation of custom templates which make new project bootstrapping much faster. With a few steps you can have an Umbraco project running without the need for a code editor.
Visual Studio is used to write native code and managed code supported by .NET and many others. Its built-in tools provide the ability to develop and execute applications for any platform. Developers will be able to install Umbraco without ever having to leave Visual Studio.
Learn how to run an already installed local installation of Umbraco.
Visual Studio Code is an editor with an embedded webserver (through the IIS Express extension). A fast way to get you up and running with Umbraco.
From Umbraco v9 and above you can use the Nightly Builds to get the latest version to use and test before it is released. Learn how to install the Nightly builds to get started.
Since Umbraco 9 it has been possible to run Umbraco CMS natively on Linux or macOS High Sierra. To get Umbraco running you will need to follow some steps.
Use the Unattended installs when spinning up Umbraco instances on something like Azure Web Apps to avoid having to run through the installation wizard.
Follow these steps to set up an Umbraco project with VS Code. The benefit of using VS Code is that it is super quick to get up and running.
Go to https://code.visualstudio.com/ and download VS Code for free.
Once installed, launch VS Code.
Click the extensions menu at the bottom on the left side. Then search for C#, install it then press reload.
Follow the Templates Guide to create your project folder.
Open your project folder in VS Code, your project will look something like this:
Now we need to tell VS Code how to run your project.
Open the command palette, you can use the shortcut Ctrl+Shift+P
, and type in Tasks: Configure
and select the Tasks: Configure Task
option:
Select "Create task.json from template"
Now select ".NET Core" as your template.
After this VS Code will have created a folder called .vscode
that contains a file called tasks.json
, it's this file that tells VS Code how to build your project.
Now that we've told VS Code how to build your project, we need to tell it how to launch it. VS Code can do this for you. First, select the little play button in the left side menu, and then select the "create a launch.json file" link.
This will prompt a menu to appear, select .NET 5+ and .NET Core:
If .NET 5+ and .NET Core is missing in the drop-down menu:
Press Ctrl + Shift + P (on Windows/Linux) or Cmd + Shift + P (on macOS) to open the Command Palette.
Search for the command .NET: Generate Assets for Build and Debug
. This command will generate the necessary assets for building and debugging your .NET application.
Now you'll see a green play button appear with a dropdown where ".NET Core Launch" is selected.
If you navigate to the Files section, a new launch.json
file is created in the .vscode
folder. When you press F5, the launch.json
file tells VS Code to build your project, run it, and then open a browser .
With that, you're ready to run the project! Press F5, or click the little green play button in the Run and Debug section to run your brand new Umbraco site locally.
This section continues from where we left off but covers the installation and configuration of Umbraco inside your web browser when you run Umbraco for the first time.
You will see the install screen where you will need to fill in some data before Umbraco can be installed.
When the installer is done you will automatically be logged into the backoffice.
Congratulations, you have installed an Umbraco site!
You can log into your Umbraco site by entering the following into your browser: http://yoursite.com/umbraco/.
A guide to install Umbraco CMS using Visual Studio.
Install the newest Umbraco dotnet templates.
In Visual Studio 2022, the .NET CLI templates are enabled to appear, by default. For information on how to enable .NET CLI templates in Visual Studio 2019, see the .NET CLI Templates in Visual Studio article.
Check the Requirements to ensure you have everything you need to start your Umbraco project.
This is an abbreviated version of the installation steps. Jump to the Create a new project section for a more thorough guide.
Open Visual Studio.
Go to File
> New
> Project
, search for Umbraco.
Choose Umbraco Project (Umbraco HQ) then click Next.
Choose or specify the parameters, leave the default or leave them all empty.
Click Create.
Use CTRL+F5 to run the project and start the Umbraco installer.
To install Umbraco we first need to install Umbraco's dotnet new templates.
For more information check the first 2 steps of the Install Umbraco with .NET CLI article.
Go to File > New > Project and search for Umbraco
in the Search for templates field.
Once you select Umbraco Project (Umbraco HQ) navigate to the next step by selecting Next.
In this step, you will be able to give your project a name specific to the project you are creating.
Refrain from changing the Solution name, as this will cause a namespace conflict with the CMS itself.
In the next step, you are able to specify some additional parameters like the Target framework. The rest are optional.
You can then click the Create button and your Umbraco Project will be ready for you.
You can now run the site through Visual Studio using F5 or the Debug button.
Follow the installation wizard and after a few steps, you will get a message saying the installation was a success.
You are now ready to start building your Umbraco project. Have a look below for different resources on the next steps.
This article describes how to run an Umbraco 9 site on a local IIS server.
This is a quick guide on getting your Umbraco website running locally on IIS.
The guide will assume you already have IIS configured and know your way around it, as well as having a local website you wish to host.
First, you need to ensure you have "Development time IIS support installed". To check this, go to the Visual Studio installer, click modify and check on the right side under "ASP.NET and web development":
Once that is installed you should set up a new IIS site - and make sure to add the hostname to your hosts file as well. Here is my setup for an example:
For the path you want to point it at the root of your site - where the .csproj
file is.
You might need to change permissions for the NuGet cache folder - C:\users\<username>\.nuget\packages
. The user or group (IIS_IUSRS) that the IIS site is running on requires Read permissions on this folder because this is where some of the files for Umbraco and Umbraco packages are being served from during development. If the IIS user or group does not have permission to read from the NuGet cache folder, you could run into a DirectoryNotFoundException
while running the site.
When the site is published these files are copied from the NuGet cache folder to wwwroot/umbraco
and wwwroot/App_Plugins
and these folders will typically have the correct permissions. For more information on setting permissions, see the File and folder permissions article.
At this point you can go to your Visual Studio solution of the site and in the Properties
folder there is a launchSettings.json
file, that looks like this:
You can add a new profile called IIS, and point it at your local domain. Here it is with my example domain:
At this point IIS will be added to the launch profiles, and you can run the site from Visual Studio by choosing IIS in the dropdown:
And finally the site is running from your local IIS: