Deploy ASP.NET App on Linux with NGINX
3 min readAug 5, 2023
Deploying an ASP.NET Core application on a Linux server with NGINX as the reverse proxy is a common approach to host web applications built using the ASP.NET Core framework. ASP.NET Core is a cross-platform framework that allows developers to build and run applications on various operating systems, including Windows, macOS, and Linux. NGINX, on the other hand, is a high-performance web server and reverse proxy that is known for its efficiency and reliability.
Deploying an ASP.NET Core application on Linux with Nginx involves a few steps. Here’s a high-level overview of the process:
Step 1: Prepare the Linux Server
- Set up a Linux server with your preferred distribution (e.g., Ubuntu 20.04 LTS).
- Install the .NET Core Runtime on the server.
- Install Nginx on the server.
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt update
sudo apt install apt-transport-https
sudo apt install dotnet-sdk-6.0
Or
sudo apt-get update && \
sudo apt-get install -y aspnetcore-runtime-7.0