Skip to content

Deploy manually

You can deploy FastAPI manually as well.

You just need to install an ASGI compatible server like:

  • Uvicorn, a lightning-fast ASGI server, built on uvloop and httptools.
$ pip install uvicorn

---> 100%
  • Hypercorn, an ASGI server also compatible with HTTP/2.
$ pip install hypercorn

---> 100%

...or any other ASGI server.

And run your application the same way you have done in the tutorials, but without the --reload option, e.g.:

$ uvicorn main:app --host --port 80

<span style="color: green;">INFO</span>:     Uvicorn running on (Press CTRL+C to quit)
$ hypercorn main:app --bind

Running on over http (CTRL + C to quit)

You might want to set up some tooling to make sure it is restarted automatically if it stops.

You might also want to install Gunicorn and use it as a manager for Uvicorn, or use Hypercorn with multiple workers.

Making sure to fine-tune the number of workers, etc.

But if you are doing all that, you might just use the Docker image that does it automatically.