Google App Engine

Types of Google App Engine: Standard vs Flexible Environments

Standard runs sandboxed runtimes that can scale to zero. Flexible runs Docker containers on VMs that always keep at least one instance running.

On this page
  1. Quick comparison
  2. The Standard environment
  3. The Flexible environment
  4. Can one app use both?
  5. How to choose
  6. Common misconceptions
  7. Next steps

App Engine has two environments, Standard and Flexible. Standard runs your code in a sandbox on supported language runtimes, can scale to zero, and includes a daily free quota. Flexible runs your app in Docker containers on Compute Engine virtual machines, accepts any language you can put in a container, and keeps at least one instance running, so it has no free tier.

Quick comparison

Standard Flexible
How code runs Sandboxed runtime (gVisor on second-generation runtimes) Docker container on a Compute Engine VM
Languages Python, Java, Node.js, PHP, Ruby, Go (specific versions) Those, plus .NET and any language in a custom container
Scale to zero Yes No; at least one instance always runs
Startup time Seconds Minutes
Writable filesystem /tmp only, held in memory Ephemeral disk
SSH into instances No Yes
Background work outside requests Limited Supported
Request timeout 10 minutes (automatic scaling); 24 hours (basic and manual) 60 minutes
Free quota 28 F-instance hours, 9 B-instance hours, and 1 GB outbound per day None
Billing Instance-hours by instance class vCPU, memory, and persistent disk, per second with a 1-minute minimum
Instance size Predefined classes (F1 to F4_1G, B1 to B8) Configurable CPU and memory

The Standard environment

Standard suits web apps written in a supported language that see uneven traffic. Instances start in seconds, and App Engine can scale them down to zero when nobody is using the app. Idle instances can keep running, and billing, for up to 15 minutes after the last request.

The free quota is useful for small projects. It covers 28 F-instance hours and 9 B-instance hours each day, plus 1 GB of outbound traffic. Standard instances do not receive sustained-use or committed-use discounts.

Standard can’t use SSH, and it writes only to /tmp. Second-generation runtimes lift many of the old restrictions: you can use any third-party library and make outbound network calls. The older, restricted sandbox applied to first-generation runtimes.

The Flexible environment

Flexible suits apps that need a runtime or system package Standard doesn’t offer, background processes, or SSH access. You describe the container with a Dockerfile and set env: flex and runtime: custom in app.yaml. You can also set the CPU and memory your instances use:

env: flex
runtime: custom
resources:
  cpu: 1
  memory_gb: 2

Flexible instances take minutes to start, and deployments take longer than Standard. Because at least one instance always runs, you pay for it around the clock, and there is no free quota. The VMs are restarted weekly for operating system patches, so your app should handle restarts.

Can one app use both?

Yes. A single App Engine application can contain services in each environment. For example, a Standard service can handle a lightweight web front end while a Flexible service runs a container with extra system packages. Each service has its own app.yaml, and all services share the application’s project and region.

How to choose

Choose Standard when:

  • Your language and framework are supported by a Standard runtime.
  • Traffic is uneven, and you want the app to scale down to zero when idle.
  • You want deployments in seconds and a free quota for a small project.

Choose Flexible when:

  • You need a language or system library that Standard can’t run.
  • Your app needs background processes or SSH access to instances.
  • You have steady traffic that justifies at least one always-on instance.

If you are starting a new container-based app on Google Cloud, also compare App Engine with Cloud Run. Google recommends Cloud Run for many new serverless apps. The pricing guide shows how the two environments bill differently.

Common misconceptions

  • “Flexible is cheaper or more scalable.” It is usually costlier for low traffic, because one instance always runs and there is no free quota.
  • “Standard is the old restricted sandbox.” Second-generation Standard runtimes allow any third-party library and outbound network access.
  • “Flexible is a different product.” It uses the same service and version model as Standard.
  • “Managed VMs is a third environment.” Older articles use that name for Flexible’s earlier beta. It is not a separate option.
  • “App Engine is the only choice for containers.” Many teams now choose Cloud Run for container workloads, which Google recommends for new projects.

Next steps

For the request path and the application, service, version, and instance hierarchy, read the App Engine architecture guide. To try Standard, follow the App Engine tutorial. For a Python web app on Standard, the Flask deployment guide shows the full workflow.

The complete guide to google app engine

Google App Engine Tutorial for Beginners
Read the guide

Keep exploring

Guides from other topics

All topics →