A how-to guide by a Developer for IIS and ASP.NET Core on Windows Server Core
Increasing performance on your Windows Server may be as easy as getting rid of the desktop enviornment, now your server is focusing more on running your apps instead of the desktop enviornment.
At bare minimum to get an ASP.NET Core Web App running you will need IIS installed and the ASP.NET Core Module. What makes this so difficult? The lack of desktop enviornment means you need to run scripts and commands to configure everything!
Let's Get Started, go ahead log in and open up powershell
Install-WindowsFeature -name Web-Server -IncludeManagementTools
That is all you need to do to install IIS!
Install ASP.NET Core
- Open up a browser on your main machine and navigate to the dotnet core downloads page
- Find the correct version you want to install and copy the runtime exe link path to your clipboard.
- Go back to your powershell terminal on the server and run the following command
wget https://download.microsoft.com/download/1/f/7/1f7755c5-934d-4638-b89f-1f4ffa5afe89/dotnet-runtime-2.1.2-win-x64.exe -OutFile dotnet-runtime-2.1.2-win-x64.exe
- Now you can run the installer
or if you want to run it quietly
& "C:/Users/App/Downloads/dotnet-runtime-2.1.2-win-x64.exe" /quiet
That is all you need to do! To confirm dotnet core is installed trying running the following command:
IIS Remote Management
You can't access the IIS Manager from Windows Server Core, so we need to configure IIS Remote Management. This will allow us to remotely log in to IIS and manage our apps.
- Open Powershell
- Install the Remote Management Service
- Update the registry to enable remote management
- Open the registry editor
- Navigate to
EnableRemoteManagement and set the value to 1
- Set the WMSVC Service to start automatically
sc config WMSVC start=auto
net start WMSVC
Configure Firewall - Add Firewall Rule
Now that we have the IIS Remote Management we need to open up the firewall so we can remotely connect.
netsh advfirewall firewall add rule name="IIS Remote Management" dir=in action=allow service=WMSVC
netsh advfirewall firewall add rule name="IIS Remote Management" dir=in action=allow protocol=TCP localport=8172
If your server is behind any type of network firewall you will need to open the following port
Time to Connect
If you do not have the IIS Manager for Remote Administration Extension installed you will need it before connection:
Now you can open IIS Manager on your other machine and connect, enjoy the performance benefit of a server that doesn't have a Desktop Environment. Have fun connecting from your other machine using IIS Manager