How to deploy .NET Core application on windows VPS

Cantech.in offers a variety of Windows VPSs that are perfect for hosting .NET Core applications. To deploy your application, you will need to follow these steps:

  1. Order a new Windows VPS from Cantech.in.
  2. Log in to your VPS and install the .NET Core Hosting Bundle and SDK.
  3. Create a new .NET Core application.
  4. Build your application.
  5. Publish your application to the IIS server.
  6. Configure IIS to host your application.
  7. Test your application.

Step 1: Order a New Windows VPS

To create a new Windows VPS from Cantech.in, visit cantech.in and select the “Windows VPS” option. You will need to choose a plan, a server location, and a term. Once you have made your selections, click the “Order” button.

After you order windows VPS , you will be receive an email of  your windows VPS credential  .

Step 2: Log in to Your VPS

Once your VPS has been created, you will need to log in to it. You can do this by using the following steps:

  1. On your local Windows PC, open the Remote Desktop Connection (RDC) client.
  2. In the “Computer” field, enter the IP address of the remote computer.
  3. In the “User name” field, enter the username of the account you want to use to log in to the remote computer.
  4. In the “Password” field, enter the password for the account you entered in the “User name” field.
  5. Click the “Connect” button.
  6. If you are prompted to allow the remote computer to connect, click the “Yes” button.
  7. You will now be logged in to the remote computer.

Step 3:Install the .NET Core runtime hosting bundle :

Ensure that the appropriate version of the .NET Core runtime hosting bundle is installed on your Windows VPS. You can download the runtime from the official .NET website (https://dotnet.microsoft.com/download/dotnet-core). 

Step 4: Install the .NET Core SDK

The .NET Core SDK is a set of tools that you will need to build and deploy your .NET Core application. To install the SDK, you can use the following steps:

Open command prompt and fire the following command:

dotnet tool install –global dotnet-sdk

Step 5: Create a New .NET Core Application

Once the .NET Core SDK is installed, you can create a new .NET Core application.

Step 6: Build Your Application

Once you have created your application, you need to build it. To do this, you can use the following steps:

  1. Open a command prompt on your VPS.
  2. Change directories to the directory where your application is located.
  3. Run the following command:

dotnet build

This will build your application and create a directory called “bin”.

Step 7: Publish Your Application to the IIS Server

Once your application is built, you need to publish it to the IIS server. To do this, you can use the following steps:

  1. Open a command prompt on your VPS.
  2. Change directories to the directory where your application is located.
  3. Run the following command:

dotnet publish

This will publish your application to the IIS server.

Step 8: Configure IIS to Host Your Application

Once your application is published, you need to configure IIS to host it. To do this, you can use the following steps:

  1. Open the IIS Manager.
  2. Click on the “Sites” folder.
  3. Right-click on the “Default Web Site” and select “Add Application”.
  4. In the “Application Name” field, enter the name of your application.
  5. In the “Physical Path” field, enter the path to the directory where your application is located.
  6. Click on the “OK” button.

Your application is now hosted on the IIS server. You can test it by opening a web browser and navigating to the IP address of your VPS followed by the name of your application.

I hope this blog has been helpful. If you have any questions, please feel free to leave a comment below.

Was this article helpful?

Related Articles