Prerequisites
I assume your use Visual Studio for your app.
We will start from a newly installe dWindows Server.
Publish your app
Using Visual Studio, simply click Build > Publish.
Add a publish profile.
Select “Folder”.
Leave the Folder location at the default value.
Now, click “Publish”.
Your Solution will now be published at the folder you have selected before.
Purchase Windows Server
Get Windows Server VPS
First, what you have to do is get a Windows Server VPS.
After getting a Windows Server VPS, get the IP address of your server.
Domain
Buy Domain
Purchase your domain. You can purchase from Namecheap.
You can follow a video guide here: How to Buy Your Own .com Domain Name on Namecheap
Update your DNS
Point your DNS to your server.
Configure Web Server
Install IIS (if not installed)
enable via: Control Panel → Turn Windows features on → Internet Information Services
Install .NET Hosting Bundle
From your Windows server, search for the latest .NET Hosting Bundle.
The latest ASP.NET Core at the time of writing is .NET 10. You can download the .NET Hosting Bundle here.
Setup Folders in Server
This is the style I prefer to organize my files and folders in the server. You may choose your own way if you want.
In C:, create folder “www”.
Then, create folder “yourdomain.com”.
Then, create 2 folders: “misc” and “publish”.
The “misc” folder will be our scratch folder where we leave things in a mess.
Our “publish” folder will contain the build files.
Copy
Copy your the published files to the server.
Create IIS site
Open IIS.
Click “Add Website”. Set App Pool.
Install Win-ACME (for automatic SSL)
Install Win-Acme
Done!
