Deploying Python Applications for Free using Render

melbdataguy
3 min readSep 22, 2023

--

Deploying Python applications can be a daunting task, especially if you’re on a tight budget. While Heroku is a popular choice for many developers, it’s important to note that Australia is not available in its free tier, making it less accessible for users in the region. However, fear not, as there’s a viable alternative — Render.

Render not only offers an easy setup process but also has a Singapore region that’s perfect for users in Australia and the Asia-Pacific region. In this article, we’ll walk you through the process of deploying a simple FastAPI application using Render’s free tier, allowing you to host your Python apps without breaking the bank.

Introducing Render

Render stands out as a cloud platform that bridges the gap left by Heroku’s regional limitations in its free tier. This platform simplifies deployment while accommodating users in Australia with its Singapore data centre.

Now, let’s dive into the steps to deploy your Python application using Render’s free tier.

Deploying a Simple FastAPI App on Render

For this tutorial, we’ll deploy a basic FastAPI application. FastAPI is a modern web framework for building APIs with Python.

Prerequisites:

  • A FastAPI application on GitHub with the following structure:
-- root folder -- 
main.py
requirements.txt
README.md
  • Ensure that the libraries used in your application are compatible with Python 3.7.10, as this is the version available in Render’s free tier.

Step 1: Create a Render Account

Begin by creating an account on Render if you haven’t already. You can do this by visiting render.com and signing up. Once registered, you’ll gain access to the Render dashboard.

Step 2: Create a New Web Service

In the Render dashboard, click on “New” and select “New Web Service.” For the purpose of this demonstration, we recommend choosing the GitHub repository that contains your FastAPI application.

Step 3: Configure Your Service

After selecting your repository, you’ll need to fill in some important details:

  • Name: Provide a unique name for your web service. This name will be a part of the URL once the deployment is complete.
  • Region: Select the region where you want to deploy your service. For the best experience in Australia, choose “Singapore (Southeast Asia)” as it’s the closest region.
  • Branch: Specify the branch of your repository you want to deploy. In most cases, “main” will be the default branch.
  • Runtime: Leave this setting at its default value.
  • Build Command: Also, leave this at its default setting.
  • Start Command: This is crucial. Enter the following command: uvicorn main:app --host 0.0.0.0 --port $PORT

Step 4: Deploy Your App

Click on “Create Web Service”, and Render will start deploying your FastAPI application. You can monitor the deployment process in the dashboard.

Step 5: Access Your App

Once the deployment is finished, Render will provide you with a unique URL in the following format: https://{name-of-app}.onrender.com. You can access your FastAPI application by opening this URL in your browser. Feel free to explore and interact with your endpoints.

Congratulations! You have successfully deployed your FastAPI application on Render’s free tier. Enjoy hosting your Python apps without breaking the bank.

It’s essential to note that this article is not sponsored by Render; I recommend it purely based on its merits.

--

--

melbdataguy

Just a curious data engineer based in Melbourne | Self-learner