---
title: "Litestar Granian · Litestar Plugins"
canonical_url: "https://litestar.dev/plugins/litestar-granian"
last_updated: "2026-08-16T03:52:42.529Z"
meta:
  description: "Granian plugin for Litestar"
  "og:description": "Granian plugin for Litestar"
  "og:title": "Litestar Granian · Litestar Plugins"
  "twitter:description": "Granian plugin for Litestar"
  "twitter:title": "Litestar Granian · Litestar Plugins"
---

# ![Litestar Granian](https://raw.githubusercontent.com/litestar-org/plugin-registry/main/icons/litestar-granian.png) Litestar Granian

Granian plugin for Litestar

[**28.3K downloads**](https://pypistats.org/packages/litestar-granian)• [**44 stars**](https://github.com/cofin/litestar-granian)• [**v0.16.0**](https://github.com/cofin/litestar-granian/releases)

[![cofin](https://github.com/cofin.png?size=40)**cofin**](https://github.com/cofin)

Run Litestar applications with Granian while preserving Litestar startup, shutdown, logging, and server integrations.

## Install

```
python -m pip install litestar-granian
```

## Run your first app

Save this as `**example.py**`:

```
from litestar import Litestar, get

from litestar_granian import GranianPlugin


@get("/")
async def hello() -> dict[str, str]:
    return {"hello": "world"}


app = Litestar(route_handlers=[hello], plugins=[GranianPlugin()])
```

Start the server:

```
litestar --app example:app run
```

Open http://127.0.0.1:8000/ in a browser, or run:

```
curl http://127.0.0.1:8000/
```

You should receive:

```
{"hello":"world"}
```

Press `**Ctrl+C**` in the server terminal to stop it.

## Why use this plugin?

- Keep the familiar `**litestar run**` command while using Granian.
- Start Litestar server integrations once around all Granian workers.
- Configure workers, protocols, logging, metrics, and static files from one CLI.

## What the plugin changes

`**GranianPlugin()**` replaces Litestar's standard `**run**` command with a Granian-backed command. It does not change commands that start another ASGI server directly.

Run the complete command reference with:

```
litestar --app example:app run --help
```

<details>

<summary>Optional event loops</summary>



The default installation uses Granian's standard loop selection and installs no optional event loop. Install and select one integration at a time:

```
python -m pip install "litestar-granian[uvloop]"
litestar --app example:app run --loop uvloop
```

On supported platforms, use the matching <code>**rloop**</code> or <code>**winloop**</code> extra and pass <code>**--loop rloop**</code> or <code>**--loop winloop**</code>.

</details>

## Next steps

- [Quickstart](https://github.com/cofin/litestar-granian/blob/main/docs/getting-started/quickstart.rst) — repeat the first run and learn what to check.
- [Configuration](https://github.com/cofin/litestar-granian/blob/main/docs/guides/configuration.rst) — choose bindings, workers, protocols, TLS, reload, and event loops.
- [Logging and metrics](https://github.com/cofin/litestar-granian/blob/main/docs/guides/logging-and-metrics.rst) — see how Granian automatically matches Litestar's formatter or accepts a complete override.
- [Deployment](https://github.com/cofin/litestar-granian/blob/main/docs/guides/deployment.rst) — forward signals and verify clean shutdown.
- [CLI reference](https://github.com/cofin/litestar-granian/blob/main/docs/reference/cli.rst) — browse every option and environment variable.

## License

`**litestar-granian**` is distributed under the [MIT License](https://github.com/cofin/litestar-granian/blob/main/LICENSE).