# Streamlit not getting AWS public IP

**URL:** <https://discuss.streamlit.io/t/streamlit-not-getting-aws-public-ip/5802>\
**Category:** Using Streamlit\
**Tags:** aws\
**Created:** [September 26, 2020, 6:25am UTC](https://discuss.streamlit.io/t/streamlit-not-getting-aws-public-ip/5802 "2020-09-26T06:25:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_Chen](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/steve_chen/32/3259_2.png) [@Steve\_Chen](https://discuss.streamlit.io/u/Steve_Chen)\
**Post date:** [September 26, 2020, 6:25am UTC](https://discuss.streamlit.io/t/streamlit-not-getting-aws-public-ip/5802/1 "2020-09-26T06:25:34Z")

</div>

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.

Local URL: [http://localhost:8501](http://localhost:8501)  
**Network URL** : [http://172.31.71.27:8501](http://172.31.71.27:8501)

---

<div class="post-metadata">

**Author:** ![randyzwitch](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/randyzwitch/32/58772_2.png) [@randyzwitch](https://discuss.streamlit.io/u/randyzwitch)\
**Post date:** [September 28, 2020, 1:52pm UTC](https://discuss.streamlit.io/t/streamlit-not-getting-aws-public-ip/5802/2 "2020-09-28T13:52:27Z")

</div>

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.

Best,  
Randy

---

<div class="post-metadata">

**Author:** ![Steve\_Chen](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/steve_chen/32/3259_2.png) [@Steve\_Chen](https://discuss.streamlit.io/u/Steve_Chen)\
**Post date:** [September 29, 2020, 9:39am UTC](https://discuss.streamlit.io/t/streamlit-not-getting-aws-public-ip/5802/3 "2020-09-29T09:39:04Z")

</div>

> [@Steve\_Chen](#):
>
> streamlit run test.py

Thank you so much Randy. It worked!!!

This is what I have done to solve the issue:

1. Connect to EC2 instance
2. Login to Windows VM
3. In the bottom-left corner of the window, Just right next to the Windows Start icon, there is a search icon, click it.
4. Type firewall
5. Click check firewall status
6. Click the advanced setting
7. Scroll down and click the inbound rule
8. On the left panel, right click the Inbound Rules
9. Click new rule
10. 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.

It worked!!!

---

<div class="post-metadata">

**Author:** ![DittoAsnar](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/dittoasnar/32/12270_2.png) [@DittoAsnar](https://discuss.streamlit.io/u/DittoAsnar)\
**Post date:** [December 14, 2021, 4:12am UTC](https://discuss.streamlit.io/t/streamlit-not-getting-aws-public-ip/5802/4 "2021-12-14T04:12:34Z")

</div>

Hi @Steve_Chen ,

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 ?
