It really is as simple as doing:
dotnet path/to/your/application.dll
- - . doc, , , , Systemd.
- , .
/etc/systemd/system/myapp.service , : :
[Unit]
Description=Example .NET Web API Application running on Ubuntu
[Service]
WorkingDirectory=/var/path/to/your/app
ExecStart=/usr/bin/dotnet /var/path/to/your/app/hellomvc.dll
Restart=always
RestartSec=10 # Restart service after 10 seconds if dotnet service crashes
SyslogIdentifier=dotnet-example
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Production
[Install]
WantedBy=multi-user.target
:
systemctl enable myapp.service
:
systemctl start myapp.service
, :
systemctl status myapp.service
, , , .
.. , . , -, Nginx, Microsoft Kestrel .