Multiple apps from a folder/file list

This is a great app. Thank you for your hard work.

Wondering if it is possible to render all python scripts as apps from a folder or file list?

1 Like

Hi Rahul_B!

While Streamlit doesn’t come with support for running multiple apps from a given folder, you can always write your own Python script to do that. Which is exactly what I did below :smiley:

Try this:

  1. Save the file below as

  2. Run this on a terminal:

    python some/folder/

And that’s it! Let me know if this works out for you.

Thanks @thiago. script runs each app as a seperate port. Was wondering if it is possible to run multiple apps in single port and with links to each app.

Oh, I see what you mean.

This isn’t supported right now in the exact way you’re describing. But you can make a Streamlit app that has a selectbox that lets you choose other apps to run inline in that same browser window. This means the selectbox will always be visible, even when you go into other sub-apps.

See this Gist:


Hi Rahul

I’ve created a multipage app here

You can take a look at the src/ file and the src/pages folder for inspiration. If you can improve it even further I would like to know.


1 Like

I am using something based on the gist @thiago posted, however streamlit doesn’t detect changes in the file which has been opened and execed. Is there a way to make this work?

1 Like

Hi @Zach_Dwiel, I’ve updated the Gist to support this.

The basic idea is that Streamlit looks at all modules in sys.modules whose source file lives in the main file’s folder (including subfolders). So in the Gist above I now add modules to sys.modules just so Streamlit will watch them :smiley:


that did the trick, thanks!

These Gists are pretty smart, thank you!

To run multiple streamlit apps on the same server in a more robust manner (and not inline), please see streamlit-launchpad which runs each app in a separate process and at a sub-folder URL.

So if I run streamlit-launchpad on a folder, the root at / shows a basic list of available apps. If I click into / it will launch the streamlit in a new process (and on a new port, but proxied through).

As ever, hopefully Streamlit will build this functionality natively soon!

1 Like

I’m facing the same problem. @danlester will your package work if ran as an entrypoint of a served docker container? I’m asking because I noticed in the code the usage of localhost and it made me a little worried.

Ideally, indeed, streamlit should expose a functionality to serve different apps. I cast my vote for that.

1 Like

Yes, streamlit-launchpad runs well in Docker.

Here is a basic image with streamlit and launchpad installed - mount your app folder to /app in the container as given in the example below:

And another one with some more scientific Python packages preinstalled:

The use of ‘localhost’ within the container is when the launchpad application starts the Streamlit sub-processes, as these are designed to run entirely within the container. Web traffic externally to the container needs only to be forwarded to the launchpad app itself, which then proxies to the relevant (localhost) Streamlit processes.

1 Like