Hi. Love Streamlit’s concept, and am enjoying tinkering with it locally. We’ve used Plotly Dash and others in the past but Streamlit looks much more suitable - depending on deployment options.
Will it be possible to host Streamlit ourselves, using Uwsgi and Nginx, to have multiple apps? I.e. domain.com/streamlit/app1 and domain.com/streamlit/app2 both running off one uwsgi config? We don’t want to have multiple uwsgis so we can quickly create a new app and have it up and running in minutes, without endless configuration and nginx routing.
This was also quite hard in Dash, so we stopped using that, but I can’t believe we’d be the only ones to find this massively useful.
HI @will, welcome to the forum! That is definitely possible. I am not an expert when it comes at Uwsgi, but I did a quick prototype with nginx in the past.
This gist has the nginx config that worked for me:
Note I had to support Websockets, so I added a couple of directives for that. Some context here.
Of course, this is a start that will work locally, but you can host it using the same strategy. Also, any proxy should let you do this kind of thing and I believe people have done several experiments with cloud setup and they documented it on the forum.
We are planning to release a StreamlitForTeams offering in the future that should make this much easier. You can sign up here: https://streamlit.io/forteams/
Hi @will, thanks for checking out Streamlit, and for the kind words!
A bit more context on the Streamlit web architecture:
Streamlit serves data over HTTP and WebSockets, using a single (configurable) port. If you have multiple Streamlit apps running on the same host, you could configure each one to use a different port, and then have your reverse proxy route HTTP/WebSocket data to the proper Streamlit app.
Streamlit uses the Tornado framework under the hood, which does not support being run in a WSGI container:
The reverse is not supported; the Tornado Application and RequestHandler classes are designed for use with the Tornado HTTPServer and cannot be used in a generic WSGI container.
But as @monchier notes, you can certainly configure Nginx as a reverse proxy for multiple Streamlits running on the same host. The Tornado docs have more details about running a Tornado app from behind nginx here: Running and deploying — Tornado 6.4 documentation
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.