Install the CLI. See the install docs.
Log in:
runway login
Add an SSH key. See key setup, or use the shortcut:
runway local key setup
Let’s deploy a small HTTP service written in .NET on Runway!
Create a new (web) project for your .NET app:
$ dotnet new web -o my-app
Then go into the my-app directory:
$ cd my-app
Create the app on Runway (this also initializes a git repository, if none exists yet):
$ runway app create
The Program.cs file will contain your route. Let’s also log all requests (using a middleware) and configure the web server through a PORT environment variable (with a default of 5000):
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
var logger = app.Logger;
string port = Environment.GetEnvironmentVariable("PORT") ?? "5000";
// middleware
app.Use(async (context, next) =>
{
logger.LogInformation("Request: {Method} {Path}",
context.Request.Method,
context.Request.Path);
await next();
});
app.MapGet("/", () => "Hello World!");
app.Run($"http://0.0.0.0:{port}");
Pay special attention to the app.Run(), by default the project will only be available on localhost.
dotnet as well: dotnet run will start the application on http://localhost:3000.Now that all is configured and setup, let’s git commit and deploy!
runway app deploy
Run runway app open to see it live, or check the Runway UI. Check runway app logs if something’s off.
Congrats, your dotnet app is now on Runway! ✅