Deploy
Streamlit
This guide walks you through deploying a Streamlit application on Takk. Streamlit is a popular framework for building data apps and dashboards in Python. Takk has first-class support for Streamlit with the StreamlitApp configuration.
Prerequisites
Make sure you have the Takk CLI installed and are logged in. If not, follow the Get Started guide first.
Create the Project
Start by creating a new directory and initializing it:
mkdir streamlit-hello
cd streamlit-hello
uv init
Add your dependencies:
uv add streamlit takk
Write the Application
Create app.py with a minimal Streamlit application. All Streamlit logic must live inside a function that Takk uses as the entrypoint:
import streamlit as st
def main():
st.title("Hello, World!")
st.write("Welcome to my Streamlit app deployed on Takk.")
name = st.text_input("What's your name?")
if name:
st.write(f"Hello, {name}!")
Define the Project
Create project.py to tell Takk how to run your Streamlit app:
from takk.models import Project, StreamlitApp
from app import main
project = Project(
name="streamlit-hello",
server=StreamlitApp(main),
)
Takk uses the StreamlitApp type to automatically configure the Streamlit server, handle networking, and set up TLS. The function you pass is the entrypoint that Takk calls to run your app.
Run Locally
Start the local development environment:
uv run takk up
Your Streamlit app is now running at http://localhost:8501. Open it in your browser to see the interactive dashboard.
Changes to your code are automatically reloaded while takk up is running.
Deploy
Deploy to the cloud with:
uv run takk deploy
Takk builds the container, provisions infrastructure, and starts your Streamlit application. TLS, networking, and scaling are handled automatically.
Next Steps
Add a custom domain to your project
Configure secrets for database connections or API keys
Adjust compute resources for data-heavy workloads
Combine with workers for background data processing

