Deploy Rasa on EC2 instance

Hey guys. I have a bot model ready as tar.gz. I now want to deploy it on EC2 ubuntu instance instead of localserver. Can someone give a brief and quick tutorial on how to do it? info like what commands I’ll have to run, what are the files I need to upload to ec2, ports etc. I’m quite new to servers so I’m having a tough time on this. Any help would be greatly appreciated.

Hi @PraneethVasarla!

It should be the same as how you did it on your local system. These would be the broad steps:

  1. Install the same version of rasa (in a virtual environment) on your server for which you have your trained model.
  2. Push your whole project code to the server.
  3. Put the trained model at the appropriate location (same as local) from where rasa could pick it.
  4. Now you need to run it, the commands are the same, but since you are running it remotely, so it would be better if you run it in detached mode. (Check out this if you don’t know how to detach.)
  5. That’s it. Since everything is left to default, so you should be able to see your rasa server running at <your_server_ip>:5005

Thanks for the answer @saurabh-m523 .

I started the server by the following command:

rasa run -m [path to my model] --enable-api

And the server is running at localhost:5005

Is that normal or am I getting it wrong? If it’s normal, how can I communicate with it from my android application? Thanks in advance.

That’s normal, if you go to <your_server_ip>:5005 from your browser you should see a hello message from rasa.

You need a frontend to talk to your bot. Have you implemented such a frontend in your app?

Haven’t yet made a fronted @saurabh-m523 . After implementing a fronted, how can I communicate with my bot through it? Thanks

Well that depends on your implementation actually. I have never made an app for such a communication so I don’t know much, but there are many channels available. You can implement your frontend to talk to your bot via any of these channels.

I can also think of a simple workaround (cuz I don’t make apps :sweat_smile:). You can setup a simple HTML page with the rasa-webchat component to talk to your bot. Now you just have to host this page and open it as a webview in your mobile app.

Hey, I want to know how do i implement this using rasa-webchat. I was successfull in implementing rasa chatbot using localhost method. Now when i moved into remote server i am getting hello from rasa on my serverip:5005 as you stated above. But im not getting the rasa webchat widget. Where did i go wrong?

@saurabh-m523 @shanrock I have deployed my rasa bot in AWS EC2 instance using docker-compose. It is running fine in the instance. But I am not able to access it through “<server_ip>:5005”. I think I am missing some configuration in EC2. I have checked the security group setting also, still not working. @shanrock are u also deploying in EC2 and what configuration have u done?

Thanks

please tell, can we also interact with the rasa bot hosted in ec2 using api request and responses, thanks.