Deploy ASP.NET Minimal API
ASP.NET Core 10 Minimal API with Scalar, health checks and tracing
Just deployed
Deploy and Host ASP.NET Minimal API with Railway
ASP.NET Minimal API is a lean way to build HTTP APIs with ASP.NET Core 10 and C#: endpoints are plain lambdas grouped by feature, without controllers. This starter adds what a production API needs from day one: health checks, OpenAPI with a Scalar UI, ProblemDetails errors, request validation and OpenTelemetry tracing.
About Hosting ASP.NET Minimal API
Railway builds the API from the repository's Dockerfile. The .NET 10 SDK restores and publishes the app, and the result runs on Microsoft's chiseled aspnet:10.0 image: about 55 MB, no shell, non-root user. Railway routes the public domain to port 8080 and waits for /health before it switches traffic to a new deployment, so a broken release never goes live. Forwarded headers are enabled because Railway terminates TLS at its edge. Tracing is switched on for the service: Railway injects the OTEL_* variables and every request shows up as a trace without extra setup.
Common Use Cases
- REST backend for a web or mobile frontend
- Internal service reached over Railway's private network
- Starting point for a larger .NET API with a database such as PostgreSQL
Dependencies for ASP.NET Minimal API Hosting
- .NET 10 SDK, only for local development; Railway builds inside Docker
- A GitHub repository with the template's code, created for you on deploy
Deployment Dependencies
Implementation Details
| Path | Purpose |
|---|---|
/ | Redirects to the Scalar API reference |
/scalar | Interactive API reference |
/openapi/v1.json | OpenAPI 3.1 document |
/health | Health check used by Railway |
/api/greetings/{name} | Example endpoint with validation |
Endpoints live in src/Api/Endpoints, one folder per feature group. Railway settings are kept as Infrastructure as Code in .railway/railway.ts.
Why Deploy ASP.NET Minimal API on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying ASP.NET Minimal API on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content