We are trying to host our new Streamlit app in a Windows VM using IIS (where we have a number of Flask/Dash apps already hosted)
We can run the app fine from within the VM (with streamlit run app.py)
We have followed the instructions listed in the above link (which is also linked to from the official ‘Deployment’ thread)
Visiting the address/port just returns “The Web server is configured to not list the contents of this directory.”, which means the app is not running and the server is looking for some default html to display when it gets no response
We managed to deploy in a Windows VM by avoiding IIS altogether and just using Task Scheduler. Perhaps a sub-optimal solution but worked a dream for our use case:
Create a batch file that simply contains streamlit run app.py (or perhaps also activates your virtualenv if you are using one) in the same directory as app.py
Open Task Scheduler, and create a new task
In the new task dialogue:
in General make sure to have ‘Run whether user is logged in or not’ checked
Create a new Trigger, we just used a daily trigger at 3am
Create a new Action. Set ‘Action’ to ‘Start a program’ and Browse for the batch file you created above
In Settings, at the bottom under ‘If the task is already running, then the following rule applies:’ select ‘Do not start a new instance’
What you end up with is an automated task that goes to start-up your app every night at 3am, unless its already running, in which case, keep the current one running!
We also specified which port we wanted to use etc. in the .streamlit/config.toml file. Plenty of docs around for that side of things.
Did you ever find a solution? I’m trying to deploy put ended up having to run the conda environment but now I’m stuck trying to figure out a url redirect.
Thanks for the solution. Can you please elaborate on the following? Steps to do the same?
Finally we need a IIS to forward to the streamlit instance, this is done by making a server Farm
* Name: streamlit app
* Add server:
* Server addres: localhost
* Advanced Settings → httpPort: 8511
I don’t know what more there is to say. In IIS, under you server, right click on “Server Farms” and select “Create Server Farm”. Then put in the info as described and continue with making the rewrite rule.
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.