While there are several options to host FastAPI applications, Render.com offers a practical free tier that’s well-suited for small projects and testing.

Render’s free tier includes:

  • 512 MB RAM
  • 0.1 CPU
  • Free SSL/TLS
  • Automatic deployments from Git
  • Custom domains

To deploy your FastAPI app on Render:


FROM python:3.11-slim

WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]

Important limitations to consider:

  • Free instances spin down after 15 minutes of inactivity
  • Spin-up time can take 30-60 seconds
  • Monthly time limit of around 750 hours

Alternative free options

According to recent discussions on Reddit (r/FastAPI), other options include:

  • Fly.io (generous free tier)
  • Deta Space (fully free)
  • PythonAnywhere (limited free tier)

For learning and small projects, these platforms provide adequate resources. However, for production applications with consistent traffic, consider upgrading to a paid tier or exploring other hosting solutions. In my production stack, I am mostly using OVH and AWS.

Remember that free tiers often come with limitations and may not be suitable for production applications that require high availability.

References:

💪
Note: Service limitations and offerings may change. Check the providers’ current terms before deploying.

Categorized in:

Short answers,

Last Update: 19/01/2025