Skip to main content

FastAPI Service

Deploying a FastAPI server on Replit is quick and easy. FastAPI is a modern web framework for building high-performance APIs with Python 3.7+.

Follow the steps below to Deploy our FastAPI server on Replit:

Step 1: Fork the template

Login to Replit and then fork the FastAPI template by using the button + Use Template on Replit. Follow the onscreen instructions to complete the fork and create a Repl.

Step 2: Deploy the API

In the Workspace header, select the Deploy button and choose Autoscale from the types of Deployments. Then, select the Set up your deployment button and use the following configuration:

  • Machine configuration: Keep the default values, which are 1vCPU and 2 GiB RAM.
  • Max number of machines: Keep the default value of 3.
  • Primary domains: Choose a domain name for your app.
  • Build command: This is optional; you can leave it blank.
  • Run command: Enter the command uvicorn main:app --host 0.0.0.0 into the Run command field.

Select the Deploy button to deploy your application.

After a few minutes, your app will be live!

In the future, if you want to update your Deployment, open the Deployments pane and either redeploy or update the config in the settings.

Was this helpful?