Running streamlit on AWS EC2 handling port issues | port 80 / port 8501 / nginx

I would like some help getting a streamlit app exposed to the basic domain name like something.com. Currently streamlit defaults to port 8501.

After extensive review of google and this discussion board, it is not clear to me how to make this happen. I understand there is something about nginx that can be done, but even as a modestly tech-savvy individual, I’m lost as to how to configure nginx with linux commands. With respect to changing the app’s port to 80, it seems like this is a security risk and not feasible. I also understand there is something about IP tables that can be done, but again, I do not understand much more than that.

If I’ve missed a Streamlit guide as to how to get this done, my apologies.

I kindly request it be explained to me like I’m five. Thanks.

So this video got me most of the way. Nginx Reverse Proxy on AWS EC2 Amazon Linux 2 - YouTube. However, I did need to troubleshoot first by terminating a prior nginx instance as described here: server - nginx.service failed because the control process exited - Stack Overflow

At this time, Port 80 redirects to a Streamlit app, but that Streamlit app hangs. That is, it does not load my app and only displays the initial Please wait... message, as seen here: http://3.135.173.3

My streamlit app is still running on the 8501 port here: http://3.135.173.3:8501

EDIT: This was the solution: [SOLVED] The Streamlit app stops with "Please wait... " and then stops ~ Linux Fixes. Also found here for reference: nginx - The Streamlit app stops with "Please wait... " and then stops - Stack Overflow

This was rather difficult to piece together and took me several frustrating hours, so may I suggest putting together a step-by-step guide by expanding the page info here App is not loading when running remotely - Streamlit Docs to make it less frustrating for future users.

Best,

Ryan

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.