This tutorial shows how to deploy your FastAPI app on Replit so it runs continuously in the cloud on a public URL.
Notes:
- You need a Replit account and a working FastAPI project.
- Deployments require a paid Replit plan. Confirm your account has Deployments access before starting.
- Make sure your app runs correctly in the workspace before deploying. Review your run command - for example, uvicorn main:app --host 0.0.0.0 --port 8080. Replit usually detects this automatically from your project.
- Deployments are now called Publishing.
- Sign in at replit.com and open your FastAPI project from the dashboard.
- In your workspace, click New Tab and select Publishing (previously called Deployments). The Publishing panel opens.
- Click Adjust Settings to choose a deployment type.
- Autoscale for APIs that need to scale with traffic
- Reserved VM for a dedicated, always-on environment.
- Click Publish. Replit builds your project and deploys it to a replit.app subdomain. This typically takes one to two minutes.
- When deployment completes, check for a green status indicator in the Published panel. Click the generated URL to confirm your FastAPI app is live. Append /docs to the URL to access the automatic API documentation.
.gif)
