Install IIS on Windows VPS for ASP.NET Core Hosting
ASP.NET Core has become one of the most popular frameworks for building modern web applications, and hosting these applications requires a properly configured web server. Internet Information Services (IIS) is Microsoft’s native web server solution that provides strong performance and seamless integration with ASP.NET Core applications. If you’re using Windows VPS hosting to deploy your projects, installing and configuring IIS on Windows VPS is an essential first step.
In this guide, you will learn to set up IIS on Windows VPS for ASP.NET Core hosting, from installation to deployment.
Table of Contents
Prerequisites to Set up IIS on Windows VPS for ASP.NET Core hosting
Before starting, you must be sure to have your administrator access from your hosting provider, like PerLod hosting, to your Windows VPS.
This guide can be applied to Windows Server 2012 R2 and later versions.
Install IIS on Windows Server
To install IIS on your Windows Server, open Server Manager and click Add Roles and Features from the Manage menu.
On the Select installation type page, choose Role-based or feature-based installation and click Next
On the Select destination server page, select your server from the server pool and click Next.
On the Select server roles page, check the box for Web Server (IIS).
A pop-up will appear asking to add required features. Click Add Features. Click Next through the Features step.
On the Role Services step, accept the default IIS role services or customize as needed. Click Next and then Install.
Wait for the installation to complete; no server restart is required.
Also, you can use the command-line method using PowerShell to install IIS. Open PowerShell as Administrator and run this command:
Install-WindowsFeature -name Web-Server -IncludeManagementTools
This command installs IIS with management tools included.
After installation, open IIS Manager to verify IIS is working. You can also open a browser and navigate to the URL below to see the default IIS page:
http://localhost
Install .NET Hosting Bundle
The .NET Hosting Bundle is required for IIS on Windows VPS to run ASP.NET Core applications. It includes the .NET Runtime, .NET Library, and the ASP.NET Core Module.
Download the latest .NET Hosting Bundle from Microsoft’s official download page.
Once your download is completed, run the installer on your Windows VPS. Follow the installation wizard to complete the setup.
After installing the Hosting Bundle, restart IIS to apply the changes. To do this, open Command Prompt as Administrator and run:
net stop was /y
net start w3svc
Configure Application Pool in IIS
Application pools in IIS on Windows VPS isolate applications for better security and stability. ASP.NET Core runs in a separate process and doesn’t require the .NET CLR to be loaded by IIS. The CoreCLR is booted within the worker process to host the application. You must configure it to No Managed Code.
To configure the Application Pool in IIS, open the IIS Manager:
- In the left panel, expand your server node and click Application Pools.
- Right-click DefaultAppPool or create a new pool and select Basic Settings.
- Set .NET CLR version to No Managed Code.
Create IIS Site
At this point, you can set up the actual website entry in IIS. This process creates the container that maps your application’s physical files to a specific network port and domain name, which allows users to access your site.
In IIS Manager, right-click the Sites folder in the Connections panel. Select Add Website from the menu.
Enter a Site name, for example, MyASPNETCoreApp.
Set the Physical path to a folder where you’ll deploy your application. For example:
C:\inetpub\wwwroot\myapp
Configure the Binding: – Type: HTTP
- Port: 80 or your preferred port.
- Host name: Leave blank for local testing or enter your domain.
Click OK to create the site.
Grant Permissions to IIS Application Pool
For security reasons, IIS runs your web application under a specific and restricted user account, the Application Pool Identity, rather than as a full administrator. By default, this restricted account does not have access to your files. You must grant this account permission to read and execute files in your application directory so the website can load correctly.
To grant permissions to the IIS Application Pool, follow these steps:
- Navigate to your application folder in Windows Explorer.
- Right-click the folder and select Properties.
- Go to the Security tab and click Edit, then Add.
- Click Locations and ensure your system is selected.
- Enter
IIS AppPool\{APP_POOL_NAME}. The {APP_POOL_NAME} is your application pool name. - Click Check Names and then OK.
- Grant Read and Execute permissions.
Publish and Deploy an ASP.NET Core Application
IIS cannot run raw source code directly; it requires a compiled version of your application. In this step, you can generate the necessary build artifacts using the publish command and transfer them to the physical path you configured on your Windows VPS.
From your development machine, publish your ASP.NET Core app using Visual Studio or .NET CLI:
dotnet publish --configuration Release
This command compiles your application in Release configuration and outputs all necessary files to the following folder:
bin/Release/{TARGET_FRAMEWORK}/publish
Then, copy the contents of the publish folder to the physical path you configured in IIS. You can use Remote Desktop, FTP, or file sharing to transfer files to your Windows VPS server.
Once you are done, open a browser and navigate to localhost or your configured hostname and port:
http://localhost
Your ASP.NET Core application should now be running on IIS on Windows VPS.
Fix HTTP Error 500.30: ASP.NET Core App Failed to Start
The HTTP Error 500.30 is one of the most common issues you may encounter after deploying to IIS. It typically means the application didn’t start. To resolve the issue, check the following:
- Verify that the .NET Hosting Bundle is installed and IIS has been restarted.
- Check application pool settings are set to No Managed Code.
- Verify folder permissions are correctly configured.
- Review application logs in the Event Viewer for specific errors.
FAQs
Do I need to install Visual Studio on Windows Server to run ASP.NET Core apps?
No. You only need the .NET Core Hosting Bundle, which includes the .NET Runtime and ASP.NET Core Module required to run the applications.
Why do I get a 500.19 Internal Server Error after deploying ASP.NET Core apps?
This error usually happens because the URL Rewrite Module is missing or your web.config file has a typo. To fix it, install the missing module and check your config file for errors.
Can I host multiple ASP.NET Core applications on a single Windows VPS?
Yes, you can host multiple websites on one server. You just need to assign each site a unique port, domain name, or IP address to keep them separate.
Conclusion
At this point, you have a fully functional IIS environment on your Windows VPS ready to host ASP.NET Core applications. Windows VPS hosting provides the dedicated resources and control needed to run .NET applications with optimal performance and security.
We hope you enjoy this guide. Subscribe to our X and Facebook channels to get the latest updates and articles on VPS hosting.