uvicorn.run()

Master programmatic ASGI server control with Python's most powerful web server

Get Started

What is uvicorn.run()?

uvicorn.run() is the programmatic interface to Uvicorn, Python's lightning-fast ASGI web server. Unlike the command-line interface, it allows you to start and configure your server directly from Python code, giving you complete control over server lifecycle and configuration.

Perfect for production deployments, testing environments, and applications that need dynamic server configuration, uvicorn.run() is the go-to choice for modern Python web applications built with FastAPI, Starlette, and other ASGI frameworks.

Requirements: Python 3.10+ (as of uvicorn 0.40.0). Python 3.14 is supported since uvicorn 0.38.0. For optimal performance, install with pip install uvicorn[standard] which includes uvloop and httptools. The latest version is 0.54.0 (September 2026). See what changed recently.

Quick Start

Get up and running with uvicorn.run() in seconds:

import uvicorn
from fastapi import FastAPI

app = FastAPI()

@app.get("/")
async def read_root():
    return {"message": "Hello, World!"}

if __name__ == "__main__":
    uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)

That's it! Your ASGI application is now running with automatic reloading enabled for development.

Explore the Guide

Each page covers one topic in depth: