Guide to Run an application in EC2 instance

— Upload file into Ec2

0. Convert pem file into ppk file with putty1. Open WinSCP2. Provide
a. Enter host nameas public DNS of the ec2 instance
b. Username of instance i.e. ec2-user
3. With WinSCP, upload the folders in EC2 volume

— Run the python API

1. Install requirements >> pip3 install -r requirements.txt2. python3 app.py

— Run python API in a parallel thread

>> sudo yum install python3 python3-pip tmux htop>> tmux new -s runapp>> pip3 install -r requirements.txt>> python3 app.py>> Detach(ctrl+B+D)

— tmux guide

1. Install tmux — sudo yum install tmux- sudo yum install python3 python3-pip tmux htop2. Within one terminal window you can open multiple windows and split-views called “panes”3. Check tmux shells — tmux ls4. To connect to that session you start tmux again but this time tell it which session to attach to:- tmux attach -t 0Note that the -t 0 is the parameter that tells tmux which session to attach to.“0” is the first part of your tmux ls output.5. New Tmux shell >> tmux new -s <name>6. Detach from Tmux shell >> Ctrl-B and press D

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Om Rastogi

Om Rastogi

I believe in an altruistic world, where creativity and imagination replace repetitive work