content="A complete step-by-step guide to deploying your Flask application on Render for free. Learn how to configure Gunicorn, requirements.txt, and build commands." /> Skip to content
Leaderboard Ad
DevOps

How to Deploy Flask on Render for Free

A complete step-by-step guide to getting your Python Flask application live in under 5 minutes.

Last Updated: February 2026 | 8 Min Read

Deploying Python applications used to be hard. Not anymore. Render has become the go-to alternative to Heroku, offering a generous free tier that includes HTTPS, Git push-to-deploy, and custom domains. Here is exactly how to do it.

1. Prepare Your Project

Before you push code, you need two critical files in your project root so Render knows how to run your app.

Create requirements.txt

This file lists all the Python libraries your app needs (like Flask).

pip freeze > requirements.txt
Create Procfile

Create a file named literally Procfile (no extension) and add the following line. This tells Render to use Gunicorn (a production server) instead of the default Flask development server.

web: gunicorn app:app

2. Push to GitHub

Render connects directly to your GitHub repository. Commit your changes and push them.

git add .
git commit -m "Prepare for deployment"
git push origin main

3. Configure Render

  1. Log in to Render.com.
  2. Click New + and select Web Service.
  3. Connect your GitHub account and select your repository.
  4. Give your service a unique name (e.g., my-awesome-flask-app).

Ensure the following settings are correct:

Runtime Python 3
Build Command pip install -r requirements.txt
Start Command gunicorn app:app

4. Environment Variables

Never commit secrets like API keys or your Flask SECRET_KEY to GitHub. Instead, add them to Render.

  • Scroll down to the Environment Variables section.
  • Add Key: SECRET_KEY
  • Add Value: (Generate a random string, or use our Password Generator)

5. Deploy!

Click Create Web Service. Render will start building your app. You can watch the logs in real-time. Once it says "Live", your app is online at https://your-app-name.onrender.com.

Congratulations! You are live.

Found this helpful?

Share it with your fellow developers!

We use cookies to improve your experience and show personalized content. Learn more