Deploy Fullstack FastAPI Application On Render For Free in 10 minutes.
Tags: fastapi, freedeployment, render, python
Published: 2024-05-06 13:06:53

### <u>Introduction:</u>
**Render** is a Platform As A Service which helps developers eliminate the complexities of deployment and allows more focus on building good applications.

**FastAPI** is a python web framework specifically known for its speed and automatic API documentation. Other awesome features include easy dependency injection and data validation thanks to  Pydantic.

That being said, lets get right to deployment!

**<u>Link to deployed app:</u>** https://swish-taskapp.onrender.com

### <u>Deployment Process</u>
1. Log into render.com and navigate to dashboard and if you are new to render, create an account with your github profile.
2. Return to dashboard after sign in and select "New Web Service"
![select new web service](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eojgxie5ddb3u2i1yq7x.png)
3. Next is to select how you wish to build the web service and you can select "Build and deploy from github repository" and click next.
![Build and deploy](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kxrzaf7rgcyu3m25rmnm.png)
4. Connect your repository. 
![connect repo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e7g91rvsn2ky2gmwfvyd.png)
5. You can decide to grant access to the entire repository or just the one you wish to deploy. In my case, I selected on the repository I wished to deploy and click install at the bottom of the page.
![select repo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nd7c0fodfv4889raw91s.png)
6. Once all authentication is complete you click connect and move to the deployment settings. 
![connect](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4z13pdtcmsn9orn78ujk.png)
7. Now, you get to configure the deployment and this is pretty straight forward as shown below. 
![configure deployment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ax1j4ydzi6rpywkz1e2w.png)
8. Further deployment setting are shown below and are project dependent mostly. My app runs on uvicorn hence the commands are as follows:
![runtime code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eigo6hth0y8ez5ncm1t1.png)
9. Next is to select free plan. Which is low performance but great for regular projects that don't require heavy functionality.
![select free plan](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cbpxvid6cedcoziwteev.png)
10. Click create and voila, your service will begin deployment!
![click create](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lvoj7kaa0fkwial1nsw8.png)

**<u>Runtime Code:</u>**
```pip install -r requirements.txt```
```uvicorn main:app --host 0.0.0.0 --port 10000```

### <u>Deployment log</u>
You can view the progress of your deployment in the logs as shown below. While deploying you get to see the success of your deployment.
![deployment log](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s1oes7fvrync0rlnxn2h.png)

After successful deployment, your service will be live and accessible at the url. The live service indication is also shown in the log terminal.
![live service](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jgbl45qxouua5un06yp0.png)

Congratulations!! You have successfully deployed your web 
service for free on render in a few minutes!