Home Windows Server Core - A Developer Walkthrough
Post
Cancel

Windows Server Core - A Developer Walkthrough

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 IIS

1
Install-WindowsFeature -name Web-Server -IncludeManagementTools

That is all you need to do to install IIS!

Install ASP.NET Core

  1. Open up a browser on your main machine and navigate to the dotnet core downloads page
  2. Find the correct version you want to install and copy the runtime exe link path to your clipboard.
  3. Go back to your powershell terminal on the server and run the following command
1
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
  1. Now you can run the installer
1
& "C:/Users/App/Downloads/dotnet-runtime-2.1.2-win-x64.exe"

or if you want to run it quietly

1
& "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:

1
dotnet --version

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.

  1. Open Powershell
  2. Install the Remote Management Service
    1
    
    Install-WindowsFeature Web-Mgmt-Service
    
  3. Update the registry to enable remote management
  4. Open the registry editor
1
regedit
  1. Navigate to HKLM\SOFTWARE\Microsoft\WebManagement\Server
  2. Edit EnableRemoteManagement and set the value to 1
  3. Set the WMSVC Service to start automatically
1
2
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.

1
netsh advfirewall firewall add rule name="IIS Remote Management" dir=in action=allow service=WMSVC

or

1
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

  • 8172

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

This post is licensed under CC BY 4.0 by the author.