I'm Andrew Hoefling, and I work for FileOnQ as a Lead Software Engineer building mobile technologies for Government, Financial and First Responders using Xamarin. 

 

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

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
    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
    
  4. Now you can run the installer
    & "C:/Users/App/Downloads/dotnet-runtime-2.1.2-win-x64.exe"
    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:

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
    Install-WindowsFeature Web-Mgmt-Service
    
  3. Update the registry to enable remote management
  4. Open the registry editor
    regedit
    
  5. Navigate to HKLM\SOFTWARE\Microsoft\WebManagement\Server
  6. Edit EnableRemoteManagement and set the value to 1
  7. 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

or

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


Share

Tags

windows-serverIISWindows Server Coredotnet core