What is Streamlit? A Complete Guide to Building and Sharing Apps in 2025
By Mukesh Kumar
Updated on May 02, 2025 | 20 min read | 1.2k views
Share:
For working professionals
For fresh graduates
More
By Mukesh Kumar
Updated on May 02, 2025 | 20 min read | 1.2k views
Share:
Table of Contents
Latest Update: Streamlit 1.44.0, released on March 25, 2025, introduces advanced theming options. This enhancement allows developers to customize the appearance of their applications such as fonts, colors, and roundness without writing any CSS. |
For those looking to bring data to life with interactive applications, Streamlit is the perfect tool. If you are a data scientist trying to predict customer churn for a telecom company, you can use Streamlit to quickly create an interactive dashboard that visualizes churn predictions, customer demographics, and service usage patterns.
In just a few lines of code, you can turn a static data model into a dynamic, shareable application.
This article will walk you through what is Streamlit, explore relevant examples, and explain how it helps you build interactive applications quickly and efficiently.
Want to learn how to develop software applications for your business? Join upGrad’s Online Software Development Courses and work on hands-on projects that simulate real industry scenarios. Along with programming languages, you’ll also learn what is Streamlit and how to use it effectively for app development.
Streamlit works by taking Python scripts and transforming them into interactive web applications. When you write a Streamlit app, you begin by creating a Python script that defines the app’s layout and logic.
The Streamlit library listens for changes in the script and automatically reruns the code when a user interacts with the app. This allows for real-time updates and a seamless user experience. As soon as you run the script, Streamlit starts a local server, which serves the app in a web browser.
The input stage occurs through Streamlit’s built-in widgets (like sliders, buttons, or text boxes) that collect user input. These inputs can be directly linked to variables in your Python code. For instance, a slider may adjust the range of data visualized in a plot, and a button could trigger a machine learning model to update its prediction.
Streamlit automatically re-renders the app whenever the input changes, ensuring that the user sees the updated output without needing to refresh the page.
The output is then dynamically generated, typically in the form of visualizations, tables, or interactive charts. Streamlit supports various Python libraries like Matplotlib, Plotly, or Seaborn for creating visualizations.
The framework integrates these directly into the app, enabling users to interact with the outputs in real time. Once the code executes and the outputs are ready, Streamlit displays them in the browser, making the app instantly responsive to user interactions.
In 2025, professionals who know what is Streamlit and how to use it will be in high demand. If you're looking to develop skills in Streamlit development, here are some top-rated courses to help you get there:
Let’s look at some of the core features of Streamlit:
Also Read: Python Cheat Sheet: From Fundamentals to Advanced Concepts for 2025
Now that you know what is Streamlit, let’s look at how you can build an app with Streamlit.
Building an app with Streamlit is not only straightforward but also incredibly fast. It allows you to take your data projects and turn them into interactive web applications with minimal effort.
Whether you're new to Streamlit or looking to improve your app-building skills, this guide will walk you through the process of creating a basic app, with data visualizations and interactive elements like buttons or sliders. By the end, you’ll have a fully functional app that allows users to interact with your data.
Now, let’s explore each of the steps in detail:
Before you begin, ensure that you have Streamlit installed on your system. Open your terminal or command prompt and run the following command:
pip install streamlit
This will install Streamlit and its dependencies. After installation is complete, confirm that Streamlit is installed correctly by running:
streamlit --version
You should see the version number of Streamlit displayed. Now you're ready to start building your app.
Create a new Python file in your project folder (e.g., app.py). This is where you’ll write all the code for your app. You can use any text editor or an integrated development environment (IDE) like VS Code or PyCharm to write your Python code.
At the top of your app.py file, import the Streamlit library along with any other libraries you plan to use for data processing or visualization. For example:
import streamlit as st
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
Streamlit makes it easy to work with data, and you can import libraries like Pandas for data manipulation and Matplotlib for plotting graphs.
Streamlit lets you display various components, such as text, titles, and interactive elements. To start, you can add a title and some text to your app:
st.title("My First Streamlit App")
st.write("This is a simple app that demonstrates how Streamlit works.")
These commands will add a title at the top of your app and a brief description. Streamlit’s st.write() method can be used to display text, data, or any other output. It automatically formats the input depending on the type (e.g., dataframes, plots, etc.).
Data visualization is one of the core features of Streamlit. In this example, let’s create a simple line plot using Matplotlib. First, create some data:
# Create a simple dataset
data = pd.DataFrame({
'x': [1, 2, 3, 4, 5],
'y': [10, 20, 25, 30, 40]
})
# Plot the data
fig, ax = plt.subplots()
ax.plot(data['x'], data['y'])
ax.set_xlabel('X-axis')
ax.set_ylabel('Y-axis')
ax.set_title('Basic Line Plot')
# Display the plot in the app
st.pyplot(fig)
This code snippet creates a basic line plot and displays it in your Streamlit app using st.pyplot(). You can modify the plot to represent any data you're working with.
Streamlit’s interactive widgets (like sliders, buttons, and text inputs) allow users to interact with your app. For example, add a slider that lets users adjust the range of the line plot:
slider_value = st.slider("Select a value", min_value=1, max_value=100, value=50)
st.write(f"Slider value: {slider_value}")
# Use the slider value to modify the plot
data['y'] = data['y'] * (slider_value / 50)
st.line_chart(data)
This code adds a slider to your app, which adjusts the y values of the line plot based on user input. The slider_value is used to scale the data, and the updated chart is displayed in real time.
You can further enhance the interactivity of your app by adding more widgets, such as buttons, text inputs, or file uploaders. For example, let’s add a button that resets the plot back to its default state:
if st.button("Reset Plot"):
data['y'] = [10, 20, 25, 30, 40] # Reset the data
st.line_chart(data)
This button resets the plot to its original state when clicked.
Once you've written the code for your app, you can run it by navigating to your project folder in the terminal and executing the following command:
streamlit run app.py
This will launch your app in the default web browser, where you can interact with it.
Once you've built your Streamlit app, the next step is to learn how to deploy Streamlit app and make it publicly accessible. Streamlit offers several deployment options, including its own cloud platform, as well as third-party services like Heroku.
Below is a simple guide on how to deploy Streamlit app using these services.
Streamlit Cloud is a platform provided by Streamlit for hosting and sharing your apps easily. It offers seamless deployment directly from your GitHub repository.
Here’s how to deploy on Streamlit Cloud:
Heroku is another popular platform for deploying web applications. It's a general-purpose cloud platform that supports various programming languages, including Python.
Here’s how to deploy your Streamlit app on Heroku:
streamlit==1.4.0
pandas==1.2.4
matplotlib==3.4.2
Additionally, create a Procfile with the following line to specify how to run your app:
web: streamlit run app.py
git init
git add .
git commit -m "Initial commit"
heroku create
git push heroku master
Also Read: Guide to Deploying Machine Learning Models on Heroku: Steps, Challenges, and Best Practices
For more control over your app's infrastructure, you can deploy it on platforms like AWS, Google Cloud, or DigitalOcean. These services provide cloud hosting and allow you to configure the environment to your needs.
Here’s how to deploy on cloud platforms:
streamlit run app.py
These deployment options give you flexibility depending on your needs, whether you're looking for a quick and easy solution or more control over your app’s infrastructure.
Managing resources effectively is crucial when hosting a Streamlit app, especially as traffic and usage grow. For scalability and availability, it’s important to monitor and allocate resources such as CPU, memory, and storage to ensure optimal performance.
There are some of the key considerations for effectively managing resources:
Pro Tip: Streamlit’s rapid prototyping nature makes it easy to iterate on your app. As you gather feedback or need to improve functionality, you can make quick changes to your code, and Streamlit will automatically update the app in real-time.
You can now use this guide as a foundation to create more complex and feature-rich applications and understand how to host Streamlit app.
Also Read: Top 36+ Python Projects for Beginners and Students to Explore in 2025
Now that you know what is Streamlit and how to build, deploy, and host apps on it, let’s look at some of the benefits and limitations of using the platform.
Streamlit has gained significant popularity in the data science community due to its ease of use, rapid development capabilities, and seamless integration with Python libraries. These features make it an ideal tool for quickly turning data projects into interactive applications without needing extensive knowledge of web development.
However, like any tool, Streamlit has its limitations. While it's great for rapid prototyping and small to medium-sized applications, there are performance bottlenecks when handling large datasets or complex applications.
Here’s a breakdown of the benefits and limitations of Streamlit to help you determine if it's the right tool for your needs:
Benefits |
Limitations |
Ease of Use: Simple syntax allows quick app development with minimal coding. | Performance Bottlenecks: Struggles with large datasets or complex computations. |
Rapid Development: Ideal for fast prototyping and sharing interactive applications. | Limited Customization: Difficult to fine-tune layouts or UI elements beyond basic features. |
Seamless Python Integration: Works well with popular Python libraries like Pandas, Matplotlib, and Plotly. | Limited Multi-Page Support: While it’s possible, Streamlit is designed for single-page apps, making multi-page designs harder to manage. |
Real-Time Interactivity: Automatically updates apps in real time as user inputs change. | No Advanced User Management: Streamlit doesn’t provide built-in user authentication or management tools for larger apps. |
Built-in Widgets: Offers a variety of interactive elements like sliders, buttons, and input fields. | Limited Deployment Flexibility: While easy to deploy on platforms like Streamlit Cloud and Heroku, it lacks fine-grained control over server configurations compared to self-hosting. |
To overcome these limitations, you can follow some of these best practices:
By following these best practices, you can create more efficient, maintainable, and user-friendly Streamlit apps that perform well, even as they scale.
Also Read: Top 15 Python Challenges for Beginners with Examples
Now that you are familiar with the benefits and limitations of Streamlit, let’s look at some of the real-life applications of the platform.
Streamlit has experienced significant growth in recent years, solidifying its position as a leading tool for building interactive data applications. Over 90% of Fortune 50 companies use Streamlit. The platform's ability to enable rapid development of interactive applications has made it a preferred choice for organizations seeking to leverage data insights effectively.
Source: Streamlit
Here are five real-life examples showing how businesses and data scientists use Streamlit to address challenges and improve decision-making.
Imagine you're a healthcare professional trying to manage and analyze patient outcomes across multiple departments. The data is scattered across various systems, making it difficult to gain a holistic view of patient progress. You need an efficient way to visualize patient demographics, treatment plans, and results in real-time.
As a financial analyst, you often find yourself dealing with large amounts of stock market data, trying to identify trends or forecast market movements. Manually analyzing this data in spreadsheets is time-consuming, and you need an efficient way to interact with and visualize real-time financial data.
As a researcher, you face the challenge of making your large and complex datasets accessible to colleagues who may not be familiar with coding. You need a tool that allows users to interactively explore the data without the need for complex setups or technical knowledge.
Imagine you’re a retail manager trying to understand customer purchasing patterns, track sales performance, and adjust your inventory accordingly. The data is there, but it’s often too complicated to interpret or too static to make real-time decisions.
As a data scientist, you're tasked with deploying a machine learning model to predict customer churn. The challenge is that stakeholders don't want to understand the complex code; they just need to see the model’s predictions and insights. You need an easy way to share the model’s results with them.
Also Read: How to Become a Software Engineer in India: A 2025 Guide to Success
Now that you know how to use Streamit, the next step is to keep upskilling yourself. Let’s explore how upGrad can help you learn app development.
Learning how to effectively use Streamlit can greatly enhance your ability to quickly build interactive data applications and share valuable insights with stakeholders. upGrad offers specialized courses designed to equip you with the essential skills needed to leverage tools like Streamlit for app development, automation, and process optimization.
While the courses covered above can help you learn app development, here are some free courses to improve your programming skills:
If you’re not sure where to start with application development, connect with upGrad’s career counseling for personalized guidance. You can also visit a nearby upGrad center for hands-on training to enhance your app development skills and open up new career opportunities!
Expand your expertise with the best resources available. Browse the programs below to find your ideal fit in Best Machine Learning and AI Courses Online.
Discover in-demand Machine Learning skills to expand your expertise. Explore the programs below to find the perfect fit for your goals.
Discover popular AI and ML blogs and free courses to deepen your expertise. Explore the programs below to find your perfect fit.
References:
https://streamlit.io/
https://discuss.streamlit.io/t/version-1-44-0/97890
https://discuss.streamlit.io/
https://streamlit.io/playground
https://docs.streamlit.io/get-started/installation/command-line
246 articles published
Get Free Consultation
By submitting, I accept the T&C and
Privacy Policy
Top Resources