Deploy Your Streamlit App to Render: A Complete Guide for pip and Astral uv
Plus the uv + Render Fix You Won't Find Anywhere Else

I'm a data analyst with development and graphic design experience. I know how to build a website from scratch, but I sometimes work with entrepreneurs and small businesses with their Wix or Squarespace sites, so basically I help them to establish their online presence. When I'm not doing that, I'm studying and blogging about data engineering, data science or web development.
Streamlit is awesome in that it gives you the ability to deploy on their platform for free, but I hate dealing with their branding - or anyone’s else branding for that matter.
Plus I spent way too much time trying to make this thing not to look like a Streamlit app to only have Streamlit Cloud undo all that hard work.
So let’s give it a professional look by hosting it to Render, which has the most gracious free offering, I’ve ever seen for hobby developers like myself, by allowing you to have up to 25,000 users on their free tier plus two custom domains! 😳🤯🤩
Let’s prep the project to be deployed.
If using pip
Step 0: Add requirements.txt
This file contains all the libraries that the server must install to run your app. You can create this file manually, or use the pipreqs package to do it for you.
pip install pipreqs
Make sure you are in the project folder before running this command. (The utf8 option was added, as there are emojis in my app).
pipreqs --encoding=utf8
You should see the new text file in your folder. Then you will need other push this file to your repository. I used Github.
If using uv
If you didn’t create any custom packages in your project, you can just create a requirements.txt file by running uv pip freeze > requirements.txt and jump to Step 1 below.
This is the custom package I created for my Pinkphi project to make it modular using setuptools in pyproject.toml and the tutorial where I shared how I did this.
...
[build-system]
requires = ["setuptools>=42"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
where = ['src']
include = ['pinkphi*'] # This is my custom package
[tool.uv.sources]
pinkphi = { workspace = true }
[dependency-groups]
dev = [
"pinkphi",
]
...
But if you did create a custom package/library, like I do, you will have to do the setup for uv a lot differently, so that it can be brought in to Render correctly and you will do it without needing to create a requirements.txt file.
Step 0: Create executable build.sh for uv to handle custom packages
Instead of using requirements.txt and pip, you can use uv.lock for reproducible deployments and an executable file. You’ll also have to create a build.sh file do to it without all the things breaking.
First, make sure the Python version you are using is consistent and references the same version in all these places:
Make sure you have it in
pyproject.tomlat the root of your projectMake sure that your Python version is the same throughout your project and in Render:
.python-version,pyproject.tomland in Render under Environment → Environment Variables: Key:PYTHON_VERSIONValue: your version of Python.
Creating the
build.shfile will give Render the instructions it needs to setup your repository code on its servers, the commands that it contains will make sure that uv gets installed properly and in the correct order. And it will create the same setup that’s in thepyproject.tomlfile that exists on your computer:Create the file at the root directory level of your project:
touch build.shAdd the following to the
build.shfile and save it:#!/bin/bash pip install uv pip install --upgrade pip uv sync --no-dev
Then run this command in Terminal to make the
build.shfile an executable one:chmod +x build.shRun the sync
uv sync --no-devon your project on your own machine before you push everything up to your repository.
Step 1: Upload the app to Github
Make sure you have your project up on Github, you can make your project public or private - it really doesn’t matter. Remember if you have secrets, like API keys, do NOT upload them with your project. You will have to create a .gitignore file and add the secrets.toml in there, so that you don’t inadvertently share them.
Step 2: Sign up to Render
Sign up and select Web Service for your application.
It’ll either look like this:

Or like this, if you already have a project in there:
- Connect your repository.
Step 3: Configuring the 💩 out of it
It’s pretty easy to connect to your GitHub project, I gave mine access to all the things and selected the project that I wanted to have it to use. You can connect to either public and private repositories, which is great!
Now for the hard part, I had to configure the app to behave like it would on my machine, it will be different depending on whether you use pip or uv.
Let’s start with pip first.
I used an post on Streamlit’s forum to help me out with this.
I selected the Free option for the Instance Type for now and added a special Build Command in order to move the secrets.toml file to the correct directory and update pip on deploy.
Specify the Python version for Render to use in the Environment Variables. For my project, it is Python 3.13.1.
Then I will set up the Advanced tab, I added my Secret Files, which where your secrets.toml will live and this will hold all the information that I have in my project on my computer. So just copy what you have in the project and paste it here, as we ignored secrets.toml when we pushed our project to Github.
If you want to move your project from testing to production, you will need to edit go into the settings in Render and edit the secrets.toml file here in this section too.
Step 4a: Build & Start Command for pip (or uv with no package) Setup
Here’s the Build Command to have Render copy the secrets file and move it to the .streamlit directory and to upgrade pip and then have pip install the requirements.txt so that my libraries are added. This will be the same if you are using uv without any custom packages.
cp /etc/secrets/secrets.toml ./.streamlit/; pip install --upgrade pip && pip install -r requirements.txt; streamlit run <appname>.py
Then add your Start Command, so it’s just whatever you use to run the app on your computer.
Your project should build and deploy without much issue. You just have to remember that if you make any changes to your secrets.toml file, you will have to manually copy and paste them into the Secrets Files section of your project in Render.
Step 4b: Build & Start Command for uv + build.sh with a package
In Render dashboard, set the Build Command to this, where we make sure to copy the secrets.toml file to the correct spot in our project and also call the build.sh to be executed last:
cp /etc/secrets/secrets.toml ./.streamlit/; bash build.sh
The Start Command will be the same as the setup for pip.
streamlit run streamlit_app.py # or whatever you named it



