At the least you should start Flask as a background process. Look into the nohup tool:

nohup flask run &

This will enable you to start the server, and terminate your SSH session. However, running production services in an IaaS cloud usually involves more work (configuring images or start up scripts, setting up monitoring, setting up redundancy etc). See Compute Engine documentation for a full overview. Depending on your scenario Google App Engine (PaaS) may be a better fit for you, as it takes care of some of this complexity.

Written by

Software engineer at Google. Enjoys working at the intersection of cloud, mobile and programming languages. Fan of all things tech and open source.

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