Deploy Python Flask to Awanio

Before deploying a Flask application, there are a number of things that you must prepare, namely:

  • Awanio account
  • ssh public key that has been registered on the Awanio dashboard page
  • git url endpoint to be used for push code. The format is
  • awan.yaml file that is placed in the top application folder

To create an application using Flask, first create a folder to store all the python scripts.

mkdir my-flask-app
cd my-flask-app

After that, create three files needed by the application, namely:, requirements.txt and awan.yaml

touch requirements.txt awan.yaml

Open the requirements.txt file to register the required packages.


Install the required package using pip:

pip install -r requirements.txt

Flask is a core package for running applications. We will use Gunicorn to run Flask in the production environment.

Next we edit the file

from flask import Flask
app = Flask(__name__)

def hello():
    return "Hello World!"

if __name__ == "__main__":

Run the following command to see the output of this application. flask run --port=5002

Please open th url http://localhost:5005 in your browser.

If the application is already running, now we will try to deploy it to Awan. For that we need to prepare information about this application and write it to the awan.yaml file

version: '1.0'
  type: python
  version: 3
  run: gunicorn --log-level debug --access-logfile - -b$PORT app:app

Do a git commit to save the file information that we have created.

git init
git add -v .
git commit -m "initial commit"

We need to add the Cloud remote repository to our project.

git remote add awan

Then push this application to Awanio:

git push awan master

Wait a few moments until the deployment is complete, then open the application url in Awanio.