Skip to content

Deployment

Running the NKO ERP on a server: what the server must provide, how configuration reaches the application in each environment, how a build is produced and published, and how to back up and roll back. It picks up where Installation leaves off — Installation gets a working copy running from source; Deployment keeps one running in production.

Page Covers
Server Requirements Windows + IIS + the .NET 6 Hosting Bundle, the app-pool settings the in-process schedulers need, the C:\upload folder tree, network paths, TLS, and the single-instance constraint.
Configuration Where settings come from and in what order, every key the application reads, what ASPNETCORE_ENVIRONMENT actually changes, and the settings that are compiled in.
Build & Publish The Release build, bundling, the Web Deploy publish profiles and the two settings they disagree on, applying migrations, and a release checklist.
Backup & Rollback Everything that holds state, why the two databases must be backed up together, and which migrations cannot be rolled back without a restore.

The deployment at a glance

flowchart TD
    DEV["Build machine<br/>dotnet publish"] -->|"Web Deploy"| APP
    subgraph SRV["Windows Server + IIS"]
        APP["NKO.Main<br/>schedulers run inside"]
        UP["C:\upload"]
        PDF["wkhtmltopdf"]
    end
    APP --> UP
    APP --> PDF
    PDF -->|"HTTPS to own host"| APP
    APP --> SQL[("SQL Server<br/>3 databases")]
    APP --> S3[("AWS S3")]
    APP --> NET["SMTP 587"]
Fact Consequence
Framework-dependent net6.0, hosted in IIS in-process The server needs the ASP.NET Core 6.0 Hosting Bundle. .NET 6 is out of support (R1-7).
Windows-only System.Drawing.Common 6.0, wkhtmltopdf.exe and hard-coded C:\ paths rule out Linux and containers.
Three schedulers run inside the web process The app pool must stay alive — AlwaysRunning, no idle time-out — or the 03:00 job and the birthday mail silently do not run.
State is kept in-process Exactly one instance: no web garden, no farm. Quartz would fire its nightly job once per process (R4-5).
Settings are split between appsettings.json and compiled code Each environment needs its own build — a build cannot be promoted from test to production (R4-4).
Nothing creates folders on disk The C:\upload tree and two template files must exist before first use (R4-2).

Two problems to fix before the next deployment

  • Asset-disposal attachments cannot be uploaded with the current configuration: the NKODestruction storage entry is missing, so every upload on a destruction request throws (R4-1). The fix is one line of configuration — see Configuration.
  • One of the two publish profiles deletes the PDF engine from the server on every publish (R4-3) — see Build & Publish.