Here’s a step-by-step guide to deploy a Python backend to Google App Engine (GAE) using the Standard Environment — suitable for most web apps (Flask, FastAPI, etc.).
✅ Prerequisites • Python 3.7 – 3.10 (GAE Standard supports specific versions) • GCP project created • gcloud CLI installed and authenticated (gcloud init)
📁 1. Project Structure (example for Flask)
my-agent-app/ ├── main.py # your app's entry point ├── requirements.txt # Python deps └── app.yaml # GAE config file
🐍 2. main.py (Example Flask App)
from flask import Flask
app = Flask(name)
@app.route('/') def hello(): return "Agent is live on App Engine!"
GAE requires the app to expose a WSGI app object in main.py by default.
📦 3. requirements.txt
Flask==2.2.5
Add all your dependencies here.
⚙️ 4. app.yaml
This is the deployment config for App Engine.
runtime: python310 # or python39 / python38 entrypoint: gunicorn -b :$PORT main:app
instance_class: F2 # Optional: F1 (free), F2, F4, etc.
automatic_scaling: target_cpu_utilization: 0.65 min_instances: 1 max_instances: 5
env_variables: ENV: "production"
💡 Tip: entrypoint must launch your app. Replace main:app if your file/module is named differently.
🚀 5. Deploy to App Engine
From your project root:
gcloud app deploy
Wait for it to deploy — takes ~1-2 mins.
🌐 6. Visit Your App
gcloud app browse
It opens your live URL, e.g.:
https://.appspot.com
🛠️ Optional: Logs, Debugging & Updates • Check logs:
gcloud app logs tail -s default
• Redeploy after changes:
gcloud app deploy
• Set Python version with runtime_config:
runtime_config: python_version: 3
💡 Good To Know • Timeout limit: 60 seconds for HTTP request handling. • Background jobs: Use Cloud Tasks, Pub/Sub, or Cloud Functions for async work. • Websockets not supported in App Engine Standard. Use Cloud Run/GKE for that.
Let me know your backend (Flask, FastAPI, etc.) and I can tailor the sample.