Backend Development 16 min read

Deploying .NET Core Applications on Linux: From Manual Setup to Docker

This guide walks .NET developers through the complete process of moving from .NET Framework to .NET Core on a Linux server, covering prerequisite tools, SSH key configuration, SDK installation, manual publishing, production‑grade setups with Supervisor+Nginx or Jexus, and finally Docker‑based deployment with automation scripts.

Fulu Network R&D Team
Fulu Network R&D Team
Fulu Network R&D Team
Deploying .NET Core Applications on Linux: From Manual Setup to Docker

With .NET 5 released, many developers still run .NET 4 on Windows; the article explains why moving to .NET Core on Linux is advantageous and outlines the required preparation, including choosing a familiar Linux distro (CentOS), installing XSHELL for SSH access, XFTP for file transfer, and configuring Git with SSH keys.

It details installing the .NET Core SDK and runtime on CentOS by adding Microsoft’s package repository and running sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm followed by sudo yum install -y dotnet-sdk-3.1 and sudo yum install -y aspnetcore-runtime-3.1 .

The publishing workflow is demonstrated using dotnet publish -o ./publish , then either uploading the publish folder with XFTP or pushing the code to a Git repository, cloning it on the server, and running dotnet publish -o /root/web/publish to generate the final binaries.

For production, the article introduces a Supervisor + Nginx solution: install Supervisor via yum install -y supervisor , enable it, configure a program block to run the .NET DLL, and set up Nginx as a reverse proxy listening on port 80 and forwarding to the application’s 5000 port. It also shows how to enable and start both services.

An alternative using the Jexus web server is presented, with installation via curl https://jexus.org/release/x64/install.sh | sudo sh and a simple site configuration that runs the .NET DLL directly.

The Docker approach covers installing Docker from the official script, creating a Dockerfile (generated by Visual Studio) that builds the app on a mcr.microsoft.com/dotnet/core/sdk:3.1 base and runs it on mcr.microsoft.com/dotnet/core/aspnet:3.1 . The image is built with docker build -f ./BuildTest/Dockerfile -t buildtest . and run with docker run -p 82:80 -dit --restart=always --name buildtest buildtest . A shell script dockerbuild.sh automates pulling the latest code, rebuilding the image with a unique tag, and redeploying the container.

Finally, the article mentions that CI tools like Jenkins or GitLab Runner can trigger these steps automatically, and that larger projects typically adopt Kubernetes‑based DevOps pipelines for scalable, rolling updates.

dockerDeploymentLinuxnginxdotnetSupervisor
Fulu Network R&D Team
Written by

Fulu Network R&D Team

Providing technical literature sharing for Fulu Holdings' tech elite, promoting its technologies through experience summaries, technology consolidation, and innovation sharing.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.