View All
View All
View All
View All
View All
View All
View All
View All
View All
View All
View All
View All

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:

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.

What is Streamlit? Key Features and Insights

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:

Placement Assistance

Executive PG Program11 Months
background

Liverpool John Moores University

Master of Science in Machine Learning & AI

Dual Credentials

Master's Degree17 Months
  • Real-Time Interactivity: Streamlit automatically updates the application in real time as users interact with it. Changes to input values, such as sliders or buttons, instantly trigger the app to refresh and display updated results, providing a dynamic user experience.
  • Built-in Widgets: Streamlit comes with a variety of pre-built interactive widgets, such as sliders, buttons, text inputs, and checkboxes. These widgets can be easily added to your app to collect user input and control the flow of data within the app.
  • Seamless Integration with Python Libraries: Streamlit fully supports popular Python libraries like Matplotlib, Plotly, Seaborn, and Pandas for data visualization and manipulation. You can directly display interactive plots and tables without needing to use additional frameworks.

You can get a better understanding of Python integration with upGrad’s Learn Python Libraries: NumPy, Matplotlib & Pandas. Learn how to manipulate data using NumPy, visualize insights with Matplotlib, and analyze datasets with Pandas.

  • Rapid Prototyping: Streamlit’s simplicity enables fast prototyping of data-driven applications. Data scientists and machine learning engineers can quickly turn their models or visualizations into interactive applications, enabling faster iteration and feedback.
  • Ease of Use: Streamlit allows users to build interactive web applications with just a few lines of Python code. There's no need for knowledge of front-end web technologies like HTMLCSS, or JavaScript, making it accessible for data scientists and developers with Python expertise.

You can get a hang of JavaScript from upGrad’s free JavaScript Basics from Scratch course. It covers variables, data types, loops, functions, and event handling. Build interactive web applications and gain the skills to create websites from scratch.

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.

How to Build an App with Streamlit? Step-by-Step Guide

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:

Step 1: Install Streamlit

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.

Step 2: Create a New Python File

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.

Step 3: Import Necessary Libraries

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.

Step 4: Add Streamlit Components to Your App

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.).

Step 5: Create and Display Data Visualizations

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.

Step 6: Add Interactive Widgets

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.

Step 7: Add More Interactivity

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.

Step 8: Run Your App

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.

If you want to build a higher-level understanding of Python, upGrad’s Learn Basic Python Programming course is what you need. You will master fundamentals with real-world applications & hands-on exercises. Ideal for beginners, this Python course also offers a certification upon completion.

How to Deploy Streamlit App? Different Options

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.

Option 1: Deploy on Streamlit Cloud

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:

  • Create a GitHub Repository: If you haven't already, push your Streamlit app (e.g., app.py) to a GitHub repository.
  • Sign Up for Streamlit Cloud: Go to Streamlit Cloud and sign in using your GitHub account.
  • Deploy Your App: Once logged in, click on "New app" and link it to your GitHub repository. Choose the repository and branch where your app.py is located.
  • Configure and Launch: Streamlit Cloud will automatically detect and run your app. You can customize your deployment settings (e.g., environment variables) if needed.
  • Access the App: After deployment, Streamlit Cloud will provide you with a URL to access your app publicly.

Option 2: Deploy on Heroku

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:

  • Create a Heroku Account: Sign up at Heroku if you don't have an account.
  • Install Heroku CLI: Download and install the Heroku CLI on your machine to interact with Heroku from your terminal.
  • Prepare Your App: Create a requirements.txt file in the same directory as your app.py to list the dependencies for your app. For example:
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
  • Deploy Using Git: Initialize a git repository (if you haven't already), commit your changes, and push your code to Heroku:
git init
git add .
git commit -m "Initial commit"
heroku create
git push heroku master
  • Access Your App: After the deployment is complete, Heroku will provide a URL to access your app online.

Also Read: Guide to Deploying Machine Learning Models on Heroku: Steps, Challenges, and Best Practices

Option 3: Deploy on Other Services (e.g., AWS, Google Cloud, DigitalOcean)

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:

  • Set Up a Virtual Machine (VM): For AWS, Google Cloud, or DigitalOcean, start by creating a virtual machine (VM) or instance.
  • Install Python and Streamlit: Once the VM is running, SSH into it and install Python and Streamlit as you would on your local machine.
  • Transfer Your App: Upload your app.py and dependencies to the cloud server using scp or any file transfer tool.
  • Run Your App: Start the app on the server by running:
streamlit run app.py
  • Access Your App: Configure the server’s firewall to allow incoming traffic on the port Streamlit uses (default is 8501). Then, open the IP address of your server in a web browser to access your app.

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.

You can also get a better understanding of how to host Streamlit app in the Cloud with upGrad’s Professional Certificate Program in Cloud Computing and DevOps. By combining theoretical understanding with hands-on projects, this program offers a step-by-step guide to mastering cloud infrastructure, automation, and continuous delivery.

How to Host Streamlit App? Most-Effective Method

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:

  • Auto-Scaling: With cloud services like AWS EC2 and Heroku, you can enable auto-scaling to automatically adjust the resources depending on demand.
  • Load Balancers: Use load balancers to distribute incoming traffic across multiple servers, ensuring high availability and preventing server overload.
  • Containerization: If you want flexibility and easier scaling, consider containerizing your app with Docker and using Kubernetes for orchestration.
  • Dyno (Container) Types: On Heroku, you can choose different dyno types for varying levels of resources. Opt for higher-performing dynos if your app needs more CPU or memory.
  • Cost Efficiency: Since you only pay for the resources consumed during usage, serverless deployments can be cost-effective, especially for low-traffic applications.

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.

If you are someone trying to integrate AI into your application development workflow, upGrad’s AI-Driven Full-Stack Development bootcamp can help you. You’ll learn how to build AI-powered software using OpenAI, GitHub Copilot, Bolt AI & more.

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.

Benefits and Limitations of Streamlit

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:

  • Organize Code into Functions: Keep your code modular by breaking it into reusable functions. This makes it easier to manage, debug, and extend your app as it grows. Avoid writing all your logic in a single script.
  • Optimize Data Handling: Streamlit can run into performance issues with large datasets. Use techniques like data caching (st.cache) to store intermediate results and avoid unnecessary re-computations. Also, consider using lighter data formats, such as CSV or Parquet, instead of handling raw data in memory.
  • Use Layouts Wisely: While Streamlit offers basic layout features, use them efficiently to enhance user experience. Group related content together using columns, expanders, or tabs to ensure a clean and organized interface.
  • Leverage Widgets for Interactivity: Streamlit’s interactive widgets (sliders, text inputs, checkboxes, etc.) can be used to make your app more engaging. Use them to allow users to dynamically interact with the data, model parameters, or visualizations, but avoid overloading the app with too many interactive elements.
  • Keep the App Simple and Focused: Streamlit is perfect for building simple, fast, and focused apps. Avoid turning your Streamlit app into a complex web application with unnecessary features. Keep the user interface intuitive and stick to the core functionality to maintain performance and usability.

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.

What are the Use Cases of Streamlit? 5 Real-Life Examples

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.

1. Healthcare: Streamlining Patient Data Dashboards

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.

  • Solution with Streamlit: You use Streamlit to build a dashboard that integrates data from multiple sources, allowing you to display key metrics such as patient recovery rates, treatment effectiveness, and patient demographics. 
    • With just a few lines of Python code, you create an interactive dashboard that updates in real-time, allowing healthcare providers to make data-driven decisions instantly. The app can be easily shared with colleagues, enabling better collaboration and improving patient care.
  • Outcome: The healthcare team can access real-time, interactive visualizations of patient data, improving decision-making and overall patient care. The app streamlines the workflow and reduces the time spent on manual data gathering.

2. Finance: Analyzing Stock Market Data

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.

  • Solution with Streamlit: Using Streamlit, you quickly create a dynamic financial dashboard that pulls live data from stock APIs. You integrate interactive charts that allow you to explore stock performance, analyze historical trends, and simulate investment strategies. 
    • By adjusting input parameters, such as stock symbols or time ranges, you can see the results update instantly, providing you with insights that help you make faster, informed investment decisions.
  • Outcome: You can analyze and visualize financial data in real time, providing better insights into market trends. The interactive app allows you to make quicker, more informed decisions and share those insights easily with your team.

3. Research: Interactive Data Exploration for Large Datasets

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.

  • Solution with Streamlit: You use Streamlit to create an interactive data exploration app that lets your colleagues filter, analyze, and visualize large datasets with ease. For example, you build a tool for exploring genomic data, where users can input gene names or conditions and see visualizations of gene expression in real time. 
    • This allows non-technical colleagues to engage with the data and extract meaningful insights, enhancing collaboration and speeding up the research process.
  • Outcome: Streamlit allows your research team to interact with the data in an intuitive way, making complex datasets more accessible and enabling quicker insights. This improves collaboration and accelerates the research process.

4. Retail: Analyzing Customer Behavior and Sales Trends

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.

  • Solution with Streamlit: You turn to Streamlit to create an interactive dashboard that visualizes sales trends, customer segmentation, and product performance. By using sliders and filters, you can segment customers based on purchase behavior or location and instantly analyze how different product categories are performing. This app helps you make data-driven decisions on inventory management and marketing strategies, improving both customer satisfaction and sales performance.
  • Outcome: The retail team can quickly analyze and visualize sales data in real time, leading to better decision-making around inventory and marketing strategies. This enhances the customer experience and improves overall business efficiency.

5. Machine Learning: Deploying a Model for Customer Churn Prediction

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.

  • Solution with Streamlit: You create a simple, interactive Streamlit app that allows stakeholders to input customer data (such as age, tenure, and usage patterns) and see the churn prediction in real-time. Streamlit’s built-in components make it easy to create a user-friendly interface, and the model’s predictions update instantly based on the user’s input. 
    • This not only makes it easy for stakeholders to visualize and understand the model but also provides a dynamic platform to test different scenarios and improve decision-making.
  • Outcome: Streamlit makes it easy to showcase machine learning models to stakeholders, allowing for quick testing and real-time predictions. The app’s interactivity provides valuable insights, helping decision-makers take immediate action based on the predictions.

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.

Learn How to Build Applications with upGrad!

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

Frequently Asked Questions

1. What are the system requirements for running Streamlit?

2. How do I manage large datasets in Streamlit without performance issues?

3. How can I deploy my Streamlit app on a server or cloud platform?

4. How do I enable real-time updates in my Streamlit app?

5. Can I use Streamlit to create multi-page applications?

6. How do I handle user authentication in a Streamlit app?

7. How do I integrate Streamlit with machine learning models?

8. What do I do if my Streamlit app isn’t displaying correctly?

9. How can I improve the UI of my Streamlit app?

10. How do I share my Streamlit app with others?

11. How do I troubleshoot Streamlit errors or performance issues?

Mukesh Kumar

246 articles published

Get Free Consultation

+91

By submitting, I accept the T&C and
Privacy Policy

India’s #1 Tech University

Executive Program in Generative AI for Leaders

76%

seats filled

View Program

Top Resources

Recommended Programs

LJMU

Liverpool John Moores University

Master of Science in Machine Learning & AI

Dual Credentials

Master's Degree

17 Months

IIITB
bestseller

IIIT Bangalore

Executive Diploma in Machine Learning and AI

Placement Assistance

Executive PG Program

11 Months

upGrad
new course

upGrad

Advanced Certificate Program in GenerativeAI

Generative AI curriculum

Certification

4 months