{
  "manifest_version": "1",
  "slug": "aspnet-core",
  "title": "ASP.NET Core",
  "headline": "Deploy an ASP.NET Core app",
  "description": "Deploy ASP.NET Core to an exe.dev VM: .NET 10 LTS, Kestrel under systemd, git push deploys, EF Core and SQLite on a real disk, and exe.dev sign-in.",
  "category": "frameworks",
  "tags": [
    "asp.net core",
    ".net",
    "dotnet",
    "c#",
    "kestrel",
    "razor pages",
    "blazor",
    "ef core",
    "sqlite",
    "sql server",
    "systemd",
    "git push deploy",
    "azure app service alternative"
  ],
  "url": "https://exe.dev/deploy/aspnet-core",
  "markdown_url": "https://exe-staging.dev/deploy/aspnet-core.md",
  "upstream": {
    "website": "https://dotnet.microsoft.com/apps/aspnet",
    "source": "https://github.com/dotnet/aspnetcore",
    "docs": "https://learn.microsoft.com/aspnet/core/host-and-deploy/",
    "license": "MIT"
  },
  "example_vm_name": "my-aspnet",
  "time": "15 minutes",
  "stack": [
    {
      "name": "Your ASP.NET Core app",
      "detail": "`dotnet publish` output, run by Kestrel as app.service under systemd, on 127.0.0.1",
      "port": 8000,
      "data": "~/app → the current release in ~/releases"
    },
    {
      "name": ".NET 10 (LTS)",
      "detail": "the SDK and ASP.NET Core runtime from Ubuntu's own packages, updated by apt"
    },
    {
      "name": "git push deploys",
      "detail": "a pre-receive hook in ~/app.git publishes, backs up, switches, and checks",
      "data": "~/app.git"
    },
    {
      "name": "SQLite",
      "detail": "EF Core with migrations in new apps; Data Protection keys beside it",
      "data": "~/data"
    },
    {
      "name": "Nightly backup",
      "detail": "app-backup.timer; data, settings, and the repository",
      "data": "~/backups"
    }
  ],
  "access": [
    {
      "url": "https://my-aspnet.exe.xyz/",
      "who": "private",
      "what": "your app, signed in with exe.dev, until you make it public"
    },
    {
      "url": "my-aspnet.exe.xyz:app.git",
      "who": "private",
      "what": "`git push exe main` deploys"
    }
  ],
  "inputs": [
    {
      "name": "REPO",
      "description": "the GitHub repository to deploy, as owner/name or a URL, or `new` to start a fresh ASP.NET Core app"
    }
  ],
  "delivers": [
    "The .NET 10 SDK installed from Ubuntu's packages, and the app published and running as app.service on 127.0.0.1:8000, enabled to come back after a reboot.",
    "A ~/app.git repository whose pre-receive hook publishes each push to main into a new release and rejects the push if the deploy fails.",
    "Settings and secrets in ~/app.env (mode 600), read by the build and by the service; ASP.NET Core sees them as configuration.",
    "Data in ~/data, backed up nightly by app-backup.timer, with the newest backup opened and checked in a scratch directory.",
    "With REPO=new, a Razor Pages guestbook on EF Core and SQLite that signs visitors in from exe.dev's X-ExeDev-Email header, makes the owner an admin, and trusts the proxy's forwarded headers."
  ],
  "deployable": true,
  "deploy": {
    "new_vm_url": "https://exe-staging.dev/new?prompt=REPO%3D%3Cfill-this-in%3E%0A%0ASet%20up%20ASP.NET%20Core%20on%20this%20VM%20by%20following%20the%20exe.dev%20recipe%20at%20https%3A%2F%2Fexe-staging.dev%2Fdeploy%2Faspnet-core.md%3Fvia%3Ddeploy%20from%20top%20to%20bottom.%0A%0AThe%20values%20at%20the%20top%20of%20this%20message%20are%20mine%3A%0A-%20REPO%3A%20the%20GitHub%20repository%20to%20deploy%2C%20as%20owner%2Fname%20or%20a%20URL%2C%20or%20%60new%60%20to%20start%20a%20fresh%20ASP.NET%20Core%20app%0AAsk%20me%20for%20any%20that%20still%20say%20%3Cfill-this-in%3E%20before%20you%20need%20them.%0A%0AThe%20recipe%27s%20example%20VM%20name%20is%20my-aspnet.%20This%20VM%27s%20name%20is%20the%20output%20of%20%60hostname%60%3A%20use%20it%20wherever%20the%20recipe%20writes%20my-aspnet.%20Skip%20the%20step%20that%20creates%20the%20VM%3B%20you%20are%20on%20it.%0A%0AYou%20are%20done%20when%20all%20of%20these%20are%20true.%20Check%20each%20one%20yourself%3A%0A-%20The%20.NET%2010%20SDK%20installed%20from%20Ubuntu%27s%20packages%2C%20and%20the%20app%20published%20and%20running%20as%20app.service%20on%20127.0.0.1%3A8000%2C%20enabled%20to%20come%20back%20after%20a%20reboot.%0A-%20A%20~%2Fapp.git%20repository%20whose%20pre-receive%20hook%20publishes%20each%20push%20to%20main%20into%20a%20new%20release%20and%20rejects%20the%20push%20if%20the%20deploy%20fails.%0A-%20Settings%20and%20secrets%20in%20~%2Fapp.env%20%28mode%20600%29%2C%20read%20by%20the%20build%20and%20by%20the%20service%3B%20ASP.NET%20Core%20sees%20them%20as%20configuration.%0A-%20Data%20in%20~%2Fdata%2C%20backed%20up%20nightly%20by%20app-backup.timer%2C%20with%20the%20newest%20backup%20opened%20and%20checked%20in%20a%20scratch%20directory.%0A-%20With%20REPO%3Dnew%2C%20a%20Razor%20Pages%20guestbook%20on%20EF%20Core%20and%20SQLite%20that%20signs%20visitors%20in%20from%20exe.dev%27s%20X-ExeDev-Email%20header%2C%20makes%20the%20owner%20an%20admin%2C%20and%20trusts%20the%20proxy%27s%20forwarded%20headers.%0A%0ARead%20the%20whole%20recipe%2C%20including%20the%20closed%20details.%20Follow%20%22Set%20up%20by%0Ahand%22%20from%20%22Install%20.NET%22%20to%20the%20end%20of%20it%2C%20as%20exedev%3B%20the%20walkthrough%0Aabove%20it%20is%20for%20the%20owner%20afterwards.%20Do%20not%20run%20Restore%20or%20Update%2C%20and%0Ado%20not%20reboot.%20Leave%20public%20sharing%20off.%20Skip%20the%20optional%20sections%0A%28SQL%20Server%2C%20Blazor%2C%20the%20LLM%20example%29%20unless%20the%20owner%20asks.%0AREPO%20picks%20one%20path%20in%20%22Get%20the%20code%22%3A%20%60new%60%20starts%20a%20fresh%20app%3B%0Aanything%20else%20is%20a%20GitHub%20repository%20%28turn%20URLs%20into%20owner%2Fname%29.%20Never%0Acommit%20to%20a%20repository%20you%20cloned%3A%20its%20settings%20go%20in%20~%2Fapp.env.%20If%20a%0Aclone%20fails%2C%20follow%20the%20private-repository%20steps%2C%20and%20if%20that%20fails%0Atoo%2C%20give%20the%20owner%20the%20integration%20command%20and%20wait%20for%20them.%0AFor%20a%20cloned%20app%2C%20read%20its%20README%2C%20appsettings%2A.json%20and%20.csproj%20files%3A%0Aset%20PROJECT%20if%20it%20has%20more%20than%20one%20web%20project%3B%20check%20its%0ATargetFramework%20%28net10.0%20builds%20as%20is%3B%20net8.0%20and%20net9.0%20are%20out%20of%0Asupport%2C%20so%20tell%20the%20owner%2C%20and%20for%20net11.0%20follow%20%22Use%20.NET%2011%22%29%3B%20put%0Aconnection%20strings%20and%20secrets%20in%20~%2Fapp.env%20as%20Section__Key%20lines%2C%0Agenerating%20secrets%20with%20openssl%20and%20asking%20the%20owner%20for%20keys%20to%20outside%0Aservices%2C%20never%20inventing%20values.%20Tell%20the%20owner%20about%20forwarded%20headers%0Aand%20sign-in%20from%20%22Behind%20the%20proxy%22%20if%20their%20Program.cs%20lacks%20them%2C%20but%0Adon%27t%20change%20their%20code.%20If%20a%20build%20fails%2C%20read%20its%20output%2C%20fix%20what%20you%0Acan%20without%20editing%20the%20code%2C%20and%20redeploy%20with%0A~%2Fapp.git%2Fhooks%2Fpre-receive%20HEAD.%0AFinish%20with%20the%20app%27s%20URL%20and%20the%20git%20commands%20the%20owner%20runs%20on%20their%0Aown%20computer%2C%20from%20%22Deploy%20with%20git%20push%22%3A%20%60git%20clone%20-o%20exe%60%20for%20a%20new%0Aapp%2C%20%60git%20remote%20add%20exe%60%20for%20a%20GitHub%20repository%2C%20then%20%60git%20push%20exe%0Amain%60%20%28or%20their%20default%20branch%29.%0A%0AFinish%20with%20the%20URLs%20I%20should%20open.%0A",
    "terminal": "curl -fsSL https://exe-staging.dev/deploy/aspnet-core/prompt.txt | ssh exe.dev new --prompt=/dev/stdin",
    "prompt": "REPO=\u003cfill-this-in\u003e\n\nSet up ASP.NET Core on this VM by following the exe.dev recipe at https://exe-staging.dev/deploy/aspnet-core.md?via=deploy from top to bottom.\n\nThe values at the top of this message are mine:\n- REPO: the GitHub repository to deploy, as owner/name or a URL, or `new` to start a fresh ASP.NET Core app\nAsk me for any that still say \u003cfill-this-in\u003e before you need them.\n\nThe recipe's example VM name is my-aspnet. This VM's name is the output of `hostname`: use it wherever the recipe writes my-aspnet. Skip the step that creates the VM; you are on it.\n\nYou are done when all of these are true. Check each one yourself:\n- The .NET 10 SDK installed from Ubuntu's packages, and the app published and running as app.service on 127.0.0.1:8000, enabled to come back after a reboot.\n- A ~/app.git repository whose pre-receive hook publishes each push to main into a new release and rejects the push if the deploy fails.\n- Settings and secrets in ~/app.env (mode 600), read by the build and by the service; ASP.NET Core sees them as configuration.\n- Data in ~/data, backed up nightly by app-backup.timer, with the newest backup opened and checked in a scratch directory.\n- With REPO=new, a Razor Pages guestbook on EF Core and SQLite that signs visitors in from exe.dev's X-ExeDev-Email header, makes the owner an admin, and trusts the proxy's forwarded headers.\n\nRead the whole recipe, including the closed details. Follow \"Set up by\nhand\" from \"Install .NET\" to the end of it, as exedev; the walkthrough\nabove it is for the owner afterwards. Do not run Restore or Update, and\ndo not reboot. Leave public sharing off. Skip the optional sections\n(SQL Server, Blazor, the LLM example) unless the owner asks.\nREPO picks one path in \"Get the code\": `new` starts a fresh app;\nanything else is a GitHub repository (turn URLs into owner/name). Never\ncommit to a repository you cloned: its settings go in ~/app.env. If a\nclone fails, follow the private-repository steps, and if that fails\ntoo, give the owner the integration command and wait for them.\nFor a cloned app, read its README, appsettings*.json and .csproj files:\nset PROJECT if it has more than one web project; check its\nTargetFramework (net10.0 builds as is; net8.0 and net9.0 are out of\nsupport, so tell the owner, and for net11.0 follow \"Use .NET 11\"); put\nconnection strings and secrets in ~/app.env as Section__Key lines,\ngenerating secrets with openssl and asking the owner for keys to outside\nservices, never inventing values. Tell the owner about forwarded headers\nand sign-in from \"Behind the proxy\" if their Program.cs lacks them, but\ndon't change their code. If a build fails, read its output, fix what you\ncan without editing the code, and redeploy with\n~/app.git/hooks/pre-receive HEAD.\nFinish with the app's URL and the git commands the owner runs on their\nown computer, from \"Deploy with git push\": `git clone -o exe` for a new\napp, `git remote add exe` for a GitHub repository, then `git push exe\nmain` (or their default branch).\n\nFinish with the URLs I should open.\n",
    "prompt_url": "https://exe-staging.dev/deploy/aspnet-core/prompt.txt"
  },
  "updated": "2026-11-16",
  "verified": "2026-11-16",
  "related": [
    "go",
    "nodejs",
    "spring-boot",
    "django",
    "sqlite",
    "postgres"
  ],
  "alternatives": [
    "Azure App Service",
    "Fly.io",
    "Railway",
    "Render"
  ]
}
