Guide to Using nssm for Windows Service Management and .NET 6 Web Application Deployment
This article introduces nssm, a Windows service wrapper, explains its features, installation steps, configuration options, common commands, and demonstrates turning a .NET 6 web application into a manageable Windows service with practical command‑line examples.
nssm (Non‑Sucking Service Manager) is a lightweight Windows service wrapper that can turn any executable, including console or GUI programs, into a service that starts automatically on boot.
Key features: supports ordinary exe programs, simple installation and modification, and automatic monitoring with automatic restart if the process crashes.
Official website: https://nssm.cc/
Configuration Details
Path – the executable to run.
Startup directory – the directory of the application.
Arguments – command‑line arguments for the executable.
Service name – the name of the created Windows service.
Common commands:
nssm install servername // create service and open configuration UI
nssm start servername // start service
nssm stop servername // stop service
nssm restart servername // restart service
nssm remove servername // delete service
nssm edit servername // edit service configuration
nssm set servername param value // set a service parameter
sc delete servername // Windows built‑in command to delete a servicePractical example: turning a .NET 6 web application into a Windows service.
Application start command:
dotnet WebApplication_nssm.dll --urls=http://*:8888/ --port=8888Installation steps using nssm:
nssm install
Path: C:\Program Files\dotnet\dotnet.exe
Startup directory: D:\TechLearn\001\Tools--nssm\WebApplication_nssm\bin\Debug\net6.0
Arguments: WebApplication_nssm.dll --urls=http://*:8888/ --port=8888
Service name: webapp8888After clicking “install service”, the service appears in the Windows Services list.
Service management commands:
D:\nssm-2.24\win64>nssm start webapp8888
D:\nssm-2.24\win64>nssm stop webapp8888
D:\nssm-2.24\win64>nssm restart webapp8888
D:\nssm-2.24\win64>nssm edit webapp8888
D:\nssm-2.24\win64>nssm remove webapp8888These commands demonstrate starting, stopping, restarting, editing, and removing the service, with corresponding success messages.
Laravel Tech Community
Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.