Hosting Umbraco in IIS
Information on hosting Umbraco on IIS
Install .NET Core Runtime
Download the .NET Core Runtime from the Download .NET page.
Ensure you download the version that matches your project’s requirements, which can be found in the requirements article.
Install the Hosting Bundle
Download the ASP.NET Core Runtime Hosting Bundle to enable IIS to run ASP.NET Core applications.
Restart IIS
After installing .NET Core Runtime, restart IIS to ensure the changes are applied.
Open Command Prompt as Administrator.
Run the following commands:
Create the Site in IIS
Next, create a new site in IIS for hosting Umbraco.
Set Application Pool
Open IIS Manager.
Right-click on Application Pools in the Connections panel.
Select Add Application Pool.
Enter the Name.
Ensure the .NET Common Language Runtime (CLR) version is set to No Managed Code.
Click Ok.
Create a Site
Open IIS Manager.
Right-click on Sites in the Connections panel.
Select Add Website.
Fill in the Site Name, Physical Path (to your Umbraco installation), and the Port.
Click Ok.
Publish the Website
You can either use the dotnet CLI or Visual Studio to publish your Umbraco website.
Option 1: Use dotnet CLI for Manual Deployment
Open the Command Prompt in the directory of your Umbraco project.
Run the following command:
Option 2: Use Visual Studio to Deploy
Open your project in Visual Studio.
Right-click on the Umbraco project in Solution Explorer.
Select Publish....
Configure Environment Variables
In IIS, you can configure environment variables for Umbraco to store sensitive data such as your connection string.
Configure Environment Variables in IIS
Open IIS Manager and select your Umbraco site.
Double-click Configuration Editor in the Management section.
Select
system.webServer/aspNetCore
in the Section dropdown.Select
ApplicationHost.config <location path='[YOUR-SITENAME]'>
in the From dropdown.
This ensures your settings will be stored in a machine specific file. The configuration files might end in a public repository and should not contain sensitive data like Connection Strings or Simple Mail Transfer Protocol (SMTP) credentials. Additionally, by default the configuration file will be overwritten during each publish processes.
Locate the environmentVariables line and open the dialog to add environment variables.
Enter the values for
ASPNETCORE_ENVIRONMENT
andConnectionStrings__umbracoDbDSN
.
Click Add.
Click Apply.
Restart IIS to apply the changes after updating the environment variables.
IIS Hosting Models
IIS can host .NET applications using two different hosting models: In-process (default) and Out-of-process.
In-process Hosting (Default)
In-process hosting runs the .NET application within the same process as the IIS worker process.
This is the default hosting model and is more efficient, as there is no inter-process communication between IIS and the application.
Default Configuration
No changes are required to your application configuration for in-process hosting. It works automatically with the default IIS settings.
Out-of-process Hosting
Out-of-process hosting allows the .NET application to run separately from the IIS worker process. IIS acts as a reverse proxy to the Kestrel server, which hosts the .NET application.
This model is useful when you need to run a .NET application in a separate process, for example, when the application requires more isolated resources or needs to scale independently from IIS.
Configuration
To enable out-of-process hosting:
Open your Umbraco project.
Locate the
.csproj
file.Add the following line:
Save the
.csproj
file.Rebuild your application.
Troubleshooting: Handling WebDAV Module Interference
Issue: A 405 error may occur when attempting to save content items in Umbraco, due to the WebDAV module blocking PUT requests.
Solution: If you encounter this issue, it may be because the WebDAV module in IIS is blocking the necessary PUT requests. This issue is not present on all IIS setups, but if you do have WebDAV installed, try disabling the WebDAV module.
Workaround:
Open the
web.config
file.Add the following code to remove the WebDAV module:
Restart IIS.
Last updated
Was this helpful?