Guide to Run an application in EC2 instance

Om Rastogi
1 min readMay 12, 2022


— 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

— 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>> 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



Om Rastogi

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