# Rasa server not accessible via public IP address of EC2 instance

**URL:** <https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304>\
**Category:** Rasa Open Source\
**Created:** [February 21, 2023, 12:28pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304 "2023-02-21T12:28:53Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZohaibRamzan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/zohaibramzan/32/22443_2.png) [@ZohaibRamzan](https://forum.rasa.com/u/ZohaibRamzan)\
**Post date:** [February 21, 2023, 12:28pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/1 "2023-02-21T12:28:54Z")

</div>

Hi rasa community,

I have deployed my project on EC2 instance using docker file. The Dockerfile is like:

FROM python:3.8-slim-buster WORKDIR /app COPY requirements.txt /app/ RUN pip install --no-cache-dir -r requirements.txt COPY . /app/ EXPOSE 5005 CMD [“rasa”, “run”, “–enable-api”, “-p”, “5005”]

and the requirements.txt file is like:

pandas  
openai  
rasa

Now the host port 80 is attached to to the container port 5005. I am getting the response on terminal using curl command.

 ![Capture3](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/7/a/7af42667f32c91dc7d49850ed06076b34cd2946d.png)

When I post the request on public address of ec2 instance. I am unable to send the request. Although in my security group port 80 is configured to accept http calls. What should I do?

---

<div class="post-metadata">

**Author:** ![rasa\_learner](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rasa_learner/32/21721_2.png) [@rasa\_learner](https://forum.rasa.com/u/rasa_learner)\
**Post date:** [February 21, 2023, 4:28pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/2 "2023-02-21T16:28:22Z")

</div>

> [@ZohaibRamzan](#):
>
> When I post the request on public address of ec2 instance. I am unable to send the request.

Hi @ZohaibRamzan, can you post the webhook endpoint of the ec2 instance?

---

<div class="post-metadata">

**Author:** ![rasa\_learner](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rasa_learner/32/21721_2.png) [@rasa\_learner](https://forum.rasa.com/u/rasa_learner)\
**Post date:** [February 21, 2023, 5:38pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/4 "2023-02-21T17:38:04Z")

</div>

Can you try running the server on a port other than 80?

---

<div class="post-metadata">

**Author:** ![ZohaibRamzan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/zohaibramzan/32/22443_2.png) [@ZohaibRamzan](https://forum.rasa.com/u/ZohaibRamzan)\
**Post date:** [February 21, 2023, 7:07pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/5 "2023-02-21T19:07:33Z")

</div>

You mean ec2 port. Currently My docker container port 5005 is bind to port 80 of the ec2 instance. What other port should I try to bind with docker port 5005?

---

<div class="post-metadata">

**Author:** ![rasa\_learner](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rasa_learner/32/21721_2.png) [@rasa\_learner](https://forum.rasa.com/u/rasa_learner)\
**Post date:** [February 21, 2023, 7:13pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/6 "2023-02-21T19:13:48Z")

</div>

1. You can bind it to like 5005:5005
2. Add, 5005 to security group
3. And request to IP:5005/…

---

<div class="post-metadata">

**Author:** ![ZohaibRamzan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/zohaibramzan/32/22443_2.png) [@ZohaibRamzan](https://forum.rasa.com/u/ZohaibRamzan)\
**Post date:** [February 21, 2023, 7:38pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/7 "2023-02-21T19:38:42Z")

</div>

No success.

 ![Capture6](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/d/d/dde4b482a0107d10b7141bfe52c69c84475a8894.png) ![Capture7](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/4/a/4afd118045f7ae6ae003bbf01193bb39ca60aa7f.png) ![Capture8](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/b/a/baaa6a2659171c320436367b57c20b03cf84733f.png)

---

<div class="post-metadata">

**Author:** ![ZohaibRamzan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/zohaibramzan/32/22443_2.png) [@ZohaibRamzan](https://forum.rasa.com/u/ZohaibRamzan)\
**Post date:** [February 21, 2023, 7:50pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/8 "2023-02-21T19:50:36Z")

</div>

![Capture9](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/4/2/429abaf1bd4be642f3915bd8075a506f816927a2.png)

---

<div class="post-metadata">

**Author:** ![rasa\_learner](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rasa_learner/32/21721_2.png) [@rasa\_learner](https://forum.rasa.com/u/rasa_learner)\
**Post date:** [February 21, 2023, 8:10pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/9 "2023-02-21T20:10:04Z")

</div>

When you access ip:port in the browser, do you get the message “Hello from Rasa”?

---

<div class="post-metadata">

**Author:** ![ZohaibRamzan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/zohaibramzan/32/22443_2.png) [@ZohaibRamzan](https://forum.rasa.com/u/ZohaibRamzan)\
**Post date:** [February 21, 2023, 8:15pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/10 "2023-02-21T20:15:47Z")

</div>

![Capture10](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/f/f/ff3f6a0f8045a6dd10c4ecca9200b043c61a0fc6.png)Gateway timed out.

---

<div class="post-metadata">

**Author:** ![ZohaibRamzan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/zohaibramzan/32/22443_2.png) [@ZohaibRamzan](https://forum.rasa.com/u/ZohaibRamzan)\
**Post date:** [February 21, 2023, 8:20pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/11 "2023-02-21T20:20:11Z")

</div>

![Capture11](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/1/4/14c4545ccd875e4a8c4d40a6d35ab4b93b322d04.png)

---

<div class="post-metadata">

**Author:** ![rasa\_learner](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rasa_learner/32/21721_2.png) [@rasa\_learner](https://forum.rasa.com/u/rasa_learner)\
**Post date:** [February 21, 2023, 8:24pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/12 "2023-02-21T20:24:34Z")

</div>

Then it should be a problem related to security group. Please remove the old SG and create a new SG and attach it to the instance and try again

---

<div class="post-metadata">

**Author:** ![ZohaibRamzan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/zohaibramzan/32/22443_2.png) [@ZohaibRamzan](https://forum.rasa.com/u/ZohaibRamzan)\
**Post date:** [February 21, 2023, 8:42pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/13 "2023-02-21T20:42:29Z")

</div>

Deleted old SG and added new SG. still not resolved

---

<div class="post-metadata">

**Author:** ![rasa\_learner](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rasa_learner/32/21721_2.png) [@rasa\_learner](https://forum.rasa.com/u/rasa_learner)\
**Post date:** [February 21, 2023, 8:54pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/14 "2023-02-21T20:54:18Z")

</div>

Can you share your docker-compose/Dockerfile?

---

<div class="post-metadata">

**Author:** ![ZohaibRamzan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/zohaibramzan/32/22443_2.png) [@ZohaibRamzan](https://forum.rasa.com/u/ZohaibRamzan)\
**Post date:** [February 21, 2023, 8:58pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/15 "2023-02-21T20:58:32Z")

</div>

FROM python:3.8-slim-buster WORKDIR /app COPY requirements.txt /app/ RUN pip install --no-cache-dir -r requirements.txt COPY . /app/ EXPOSE 5005 CMD [“rasa”, “run”, “–enable-api”, “-p”, “5005”]

The requirements.txt file has three libraries as below

pandas openai rasa

The above docker file is being used for image creation and then container.

---

<div class="post-metadata">

**Author:** ![rasa\_learner](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rasa_learner/32/21721_2.png) [@rasa\_learner](https://forum.rasa.com/u/rasa_learner)\
**Post date:** [February 21, 2023, 9:03pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/16 "2023-02-21T21:03:36Z")

</div>

What’s the `docker command` you use to run the container?

---

<div class="post-metadata">

**Author:** ![ZohaibRamzan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/zohaibramzan/32/22443_2.png) [@ZohaibRamzan](https://forum.rasa.com/u/ZohaibRamzan)\
**Post date:** [February 21, 2023, 9:05pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/17 "2023-02-21T21:05:49Z")

</div>

[Dockerfile](https://forum.rasa.com/uploads/short-url/t9F7xtXdSKLdtCtootsAmxiqoj8) (201 Bytes)

sudo docker run -d -p 5005:5005 --name rasa-server image\_id

---

<div class="post-metadata">

**Author:** ![rasa\_learner](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rasa_learner/32/21721_2.png) [@rasa\_learner](https://forum.rasa.com/u/rasa_learner)\
**Post date:** [February 21, 2023, 10:18pm UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/18 "2023-02-21T22:18:47Z")

</div>

So, the situation is the endpoint is accessible within the instance but not outside the instance, right? In that case, it should be related to the SG!

---

<div class="post-metadata">

**Author:** ![ZohaibRamzan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/zohaibramzan/32/22443_2.png) [@ZohaibRamzan](https://forum.rasa.com/u/ZohaibRamzan)\
**Post date:** [February 23, 2023, 10:41am UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/19 "2023-02-23T10:41:13Z")

</div>

Thanks for your help. The issue was not related to SG. It was port forwarding issue. Which i resolved by running these below two commands.

sysctl net.ipv4.conf.all.forwarding=1, iptables -P FORWARD ACCEPT

---

<div class="post-metadata">

**Author:** ![ZohaibRamzan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/zohaibramzan/32/22443_2.png) [@ZohaibRamzan](https://forum.rasa.com/u/ZohaibRamzan)\
**Post date:** [February 23, 2023, 10:43am UTC](https://forum.rasa.com/t/rasa-server-not-accessible-via-public-ip-address-of-ec2-instance/57304/20 "2023-02-23T10:43:11Z")

</div>

Now my both rasa server and action server are working and I am able to get the responses through postman. How can I get the rasa widget configured on public IP address to show the client how chatbot is working? kindly help.
