The following lines were my first testing program using AWS EC2 (Window Sever 2019) and streamlit.
The “Network URL” I got was AWS’ Private IPs 172.31.71.27, which can’t be access from outside!
My question is how can Streamlit set the “Network URL” to AWS’ IPv4 Public IP 3.235.195.213, so that everyone can access from the world?
Thank you so much! (After googling, I am so desperately!)
(base) C:\Users\Administrator>streamlit run test.py
Hello, World!
You can now view your Streamlit app in your browser.
Hi @Steve_Chen, welcome to the Streamlit community!
The IP address shown by Streamlit is somewhat misleading when deployed on a cloud service like AWS, as it refers to the IP address of the machine on the AWS internal network. What you need to do is go to the AWS console for the machine you started and see what the external IP address is listed by AWS.
Additionally, you need to open the AWS firewall to allow the post you are using to be accessed by the outside world (by default, 8501). AWS and many other cloud providers have machines closed to the outside world by default for security reasons, so that you don’t accidentally provide access that was unintended.
In the bottom-left corner of the window, Just right next to the Windows Start icon, there is a search icon, click it.
Type firewall
Click check firewall status
Click the advanced setting
Scroll down and click the inbound rule
On the left panel, right click the Inbound Rules
Click new rule
Create an inbound rule by filling in the protocol type with TCP, port numer: 8501…
Find my public IP in EC2 console: 3.235.195.213
In the browser, type 3.235.195.213:8501
And it connected to the streamlit app that I ran in the server.
I’m also running on AWS Windows Server and having the same problem as you were. I tried your solution to add firewall inbound rules to port 8501 and still can’t get streamlit to open on public IP.
Can you give some suggestions ? Am I missing something ?