Multiple apps on same server

Our ideal scenario is:

– one server hosting multiple apps (streamlit run entrypoint, not app-per-port)
– subpaths per app (so shareable + linkable urls)

We have successfully hacked it so we dynamically load available dashboards and a switchboard dropdown dynamically module.run()s the dashboard of interest.

However, we’re stuck on shareable URLs. Our original idea was look at the session header and pull out page#subpath … except we don’t get that header, just the root.

Any other ideas on how to get fragment urls? Or maybe there is a way to map all subpaths to the same entrypoint, and thus the session header reports which is being triggered?

1 Like

Hey @lmeyerov, welcome to the community :wink:

If you have a dropdown which loads the dashboard you need, the feature you’re asking for reminds me of this PR. The value of your dropdown would be pushed as a query string, and each of your dashboards would effectively be a subpath.

If it fits your needs, we could ping the PR and eventually help there.
Fanilo

Yep, this would get far! Will continue on the thread.

1 Like

I also need the same but right now am creating the main dashboard which links me to other sub dasboards

Hi @lmeyerov , how did you finally solve your problem of serving different apps on different routes. I am trying to do something similar. In brief I plan to put streamlit apps in containers and serve them on
domain.com/<app name> using a reverse proxy. The problem is that I don’t have a hand on the reverse proxy and I cannot set the root prefix stripping, therefore I have to somehow mount my apps on different routes.

Any idea would be helpful.

Thanks!

Hi @Kasibanteg you have probably solved your problem already, since it some time ago you have posted it. But in case you have not, Streamlit now enables multipage app and this feature would be ideal for what you are trying to do:

You can got it with NGINX lib at Ubuntu/Windows server.

The problem is I cannot change the settings on the ngnix (I am not admin, and settings are fixed). But my colleague found an elegant solution. You can set the base path url in the config.toml file.

[server]
port = 5000
baseUrlPath = "my-app-name"

Like this your app will be served on https:/<your-domain>/<my-app-name>/

Hope this helps someone else :slight_smile:

1 Like

Individual .streamlit folder for each project

i am trying to initialize 2 apps on the same server i have used the recommended folder structure, but sadly, every time i start the apps, the config.toml file for each is ignored and instead a completly new file is created in %userprofile%/.streamlit/config.toml.

can someone help?

i am trying to start the servers on the cmd using:
python -m streamlit run D:\Folder\1_Script.py

but right after the config.toml inside the project is ignored, my folder structure:

  • project_1.streamlit\config.toml

  • project_1\streamlit_app.py

  • project_2.streamlit\config.toml

  • project_2\streamlit_app.py