How to host an streamlit app on Apache server


I am not sure if I am posting at the correct place.

I am trying to host a streamlit app on Apache server.
I went through the community, and tried the config as follows:
<VirtualHost *:80>
RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /tst ws://$1 [R]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteRule /tst$1 [R]
ProxyPassReverse /tst http://localhost:8501

It works on my local machine but does not work externally. Just wondering if anyone has experience on this. It is my first time applying Apache server, so quite confused.


Hi Yang_Zhang,

I found this that has helped me to deploy streamlit into a website. I have not finished the configuration, but despite it looks similar to your code they differ in a couple of points.

Try with that one.


1 Like