8

I have small app created on python flask and deployed on EC2 aws machine, when I do ssh to ec2 machine and starts flask, it works, but when I terminate the session the flask dies, I can run it using nohup. What is the best way to make it independent of ssh session and run it continuously.

Cœur
  • 37,241
  • 25
  • 195
  • 267
meraj
  • 195
  • 2
  • 3
  • 14

1 Answers1

20

There are several options:

  1. nohup python app.py &
  2. use screen
  3. run supervisord(link) on system startup and control all through it (pythonic way :))

nohup means: do not terminate this process even when the stty is cut off.

& at the end means: run this command as a background task.

Mike
  • 399
  • 3
  • 4