Get/write data on Server1 and display GUI on Server2

  1. I want to use streamlit to read database on Server1, and also some business logics run on server1. And I want to display the GUI on Server2( web server), user can interact with GUI on Server2, and the result shoubl be written back to Server1. Is it supported currently?

  2. I want to embedded streamlit GUI into my web pages, that means ,it’s only a part of my whole pages. what should I do?


Hi @aispring, welcome to Streamlit!

Yes, this should be possible. In your example, “Server2” would be the server running your Streamlit app. In your app, you’d need to open a database connection to Server1 and use it to fetch data to display, and write back user results. You’ll probably want to use @st.cache to maintain your database connection, so that you don’t have to re-open and close it every time the app is re-run. This can be a bit tricky, but a number of users are running Streamlit in this sort of configuration, so please ask for help if you run into a specific scenario you’re unsure of!

To embed your Streamlit app in another web page, you should be able to simply wrap it in an <iframe>.

1 Like

If I run streamlit on Server1, on which it can access the db and business logic easily on Server1. After the streamlit startup, I can use iframe src=server1:port to display GUI on server2. Is there any problem?

That sounds right to me!