Testing and Deploying Your Application

Running locally

You run your application locally with the native development tools that you usually use.

For details, including specific commands depending on your plugin, see Local testing for the Java 8/Jetty 9 runtime or Local testing for the Java 8 runtime.

Deploying your application

Java provides several different tools to deploy to App Engine flexible environment. For command-line deployment, use the Maven or Gradle plugins. To deploy using an IDE, use the IntelliJ plugin. To programmatically deploy your apps, use the Admin API.

Manually building a container for deployment

To build your container images outside of Google Cloud Platform, you must first upload your images to a container image repository before you can deploy your images to App Engine with the gcloud app deploy command.

For example, if you build your container images locally with Docker, you can push those images to Google Container Registry and then specify the URL of your image in the --image-url flag of the command:

gcloud app deploy --image-url gcr.io/[MY_PROJECT_ID]/[MY_CONTAINER_IMAGE]

Docker base images for Java

If you'd like to build a Java custom runtime application from scratch, you can use one of the following base images in a Dockerfile:

Runtime Docker command
Java 8 FROM gcr.io/google_appengine/openjdk
Java 8 / Jetty 9 FROM gcr.io/google-appengine/jetty

Viewing your application

After you deploy your app to App Engine, you can run the following command to launch your browser and view the app at http://[YOUR_PROJECT_ID].appspot.com:

gcloud app browse


The following is a common error message that you might encounter when deploying apps:

PERMISSION_DENIED: Operation not allowed
The "appengine.applications.create" permission is required.
If the GCP project does not include the required App Engine application, the gcloud app deploy command can fail when it tries to run the gcloud app create command. Only accounts with Owner role have the necessary permissions to create App Engine applications.

Send feedback about...

App Engine flexible environment for Java docs