← All posts

IIS on DigitalOcean for .NET? Here's the Linux + nginx path (and how to move)

Searching “DigitalOcean IIS” usually means one thing: you’re used to deploying ASP.NET to a Windows Server box with IIS, and you’re looking for the DigitalOcean equivalent. The short answer is that there isn’t one, directly — DigitalOcean’s Droplet marketplace has no official Windows Server image at all. You can upload your own licensed Windows Server ISO as a custom image and run IIS on top of it, but it’s more setup than a marketplace image, it needs your own Windows Server license (DigitalOcean doesn’t sell or include one), and a Windows Droplet with enough RAM to run IIS comfortably costs more than the equivalent Linux box for the same app.

The better path, if the app is ASP.NET Core (.NET 6 or later): skip Windows and IIS entirely. ASP.NET Core runs first-class on Ubuntu, using Kestrel as the app server behind nginx as a reverse proxy — a combination that’s been the default deployment shape for the framework since it stopped being Windows-only. It’s the same Ubuntu setup used in the DigitalOcean deploy walkthrough; this post is the IIS side of that decision, mapping what you already know onto it.

IIS concepts, mapped to Linux

IISLinux equivalent
Application poolA systemd unit (myapp.service) running dotnet MyApp.dll under Kestrel
Site binding (host header, port)An nginx server block with server_name and a proxy_pass to Kestrel’s loopback port
web.configappsettings.{Environment}.json plus environment variables (ConnectionStrings__Default, etc.)
App pool recyclingRestart=always in the systemd unit — see the systemd service walkthrough for the full unit file
IIS URL Rewrite modulenginx rewrite/return directives in the same server block
IIS Manager GUIsystemctl status myapp, journalctl -u myapp -f, and editing the unit/nginx config files directly — there’s no GUI, but there’s also nothing to click through five dialogs to find
Windows Authentication (Kerberos/NTLM against Active Directory)Not available on Linux the same way. If a customer’s app genuinely depends on Windows Auth against an on-prem AD, that’s a real reason to stay on Windows/IIS — everything else below assumes it doesn’t

The mapping holds because ASP.NET Core was built to be host-agnostic from the start: the same compiled app that IIS proxies to dotnet.exe on Windows is the same app nginx proxies to on Linux. Nothing about the application code changes.

The one thing that doesn’t map: .NET Framework

This only works for .NET (Core) 6 and later — the cross-platform runtime. Classic .NET Framework apps (anything targeting net48, net472, and earlier, including most WebForms and older MVC apps that haven’t been retargeted) are Windows-only; there’s no Linux runtime for .NET Framework, full stop, and no nginx/Kestrel combination changes that. If the app is still on .NET Framework, IIS on a Windows Droplet — or moving it to Azure App Service — is the honest answer, not this post. Porting it to modern .NET first is a separate, real project; it’s usually worth it for the hosting flexibility and performance gains, but it’s not a weekend task for anything nontrivial.

Setting it up on Ubuntu

The full step-by-step — Droplet creation, firewall, the .NET runtime install, the systemd unit, nginx, and certbot for HTTPS — is in the DigitalOcean deploy walkthrough and the systemd service post. None of it needs Windows knowledge; if you’ve configured an IIS site and an app pool before, nginx.conf’s server block and the systemd unit’s [Service] section are doing the exact same two jobs, just in plain text files instead of IIS Manager’s dialogs.

The one-click way

Writing the nginx config and systemd unit by hand once is a reasonable way to learn the mapping above. Doing it identically on every server, for every app, for as long as the product runs, is where it turns into maintenance work nobody signed up for. DotDeployer replaces the manual path with three steps:

  1. Connect DigitalOcean. Paste a Personal Access Token scoped to your account.
  2. Add your site from GitHub. DotDeployer provisions the Droplet, hardens it, installs the matching .NET runtime, and writes the nginx config and systemd unit for you.
  3. Push. DotDeployer builds the release, issues the HTTPS certificate, and switches the current symlink over with a health check first.

No IIS, no Windows license, no custom image to build — just the Droplet, in your own DigitalOcean account, running the same ASP.NET Core app you’d have deployed to IIS.

Deploy it with DotDeployer

Connect your DigitalOcean account, add a site from your GitHub repo, and DotDeployer provisions the Droplet, hardens it, and configures nginx and HTTPS automatically -- then redeploys on every push.

Deploy to DigitalOcean with DotDeployer · Getting started