Run and Debug an App Engine Standard App Locally

This document describes how to locally run and debug an App Engine standard application from within IntelliJ IDEA.

Before you begin

  • Follow the Quickstart to install and set up IntelliJ IDEA, Ultimate Edition.

  • Install the Google Cloud SDK Java Extensions:

    gcloud components install app-engine-java
  • Ensure your application is an App Engine standard project that contains an appengine-web.xml file

Running your application locally

To run an App Engine application locally, do the following:

  1. Choose File > Open to open the project you want to run.

  2. Browse to the directory containing your project.

  3. Choose Tools > Google Cloud Tools > Run on a local App Engine Standard dev server.

    Screenshot showing the navigation to the
     Run on a local App Engine Standard dev server menu option.

The project takes a moment to build.

Editing the run configuration

You can edit the run configuration for your local server as follows:

  1. Choose Run > Edit Configurations.

    Screenshot showing the Run/Debug Configurations dialog.

  2. Update configuration settings as needed. Some common ones include:

    • Artifact to deploy
    • App Engine Host
    • App Engine Port
  3. When finished, click OK.

Stopping the server

To stop the Dev App Server, choose Run > Stop 'Google App Engine Standard Local Server'.

Debugging the application

You can use the run configuration you previously created to run your application in debug mode as follows:

  1. Choose Run > Debug.

  2. In the dialog, click Google App Engine Standard Local Server.

  3. After the project builds, you can set breakpoints to debug your app.

Running your application locally on Community Edition

IntelliJ Community Edition does not provide native support for running local Java servlet-based applications. To run your application locally using IntelliJ Community Edition, configure your project as a Maven or Gradle based project by using the Maven or Gradle plugins.

These guides also include instructions on configuring the development server for debugging. Connecting your debugger is as simple as configuring an IntelliJ remote debug configuration.

Once your Gradle or Maven project is properly configured, you can start the local server from the Gradle or Maven toolbox in the margin of your IDE.

Screenshot showing the Run/Debug Configurations dialog.

Make sure that the port number is the same as the port in the VM options you configured in your Gradle or Maven App Engine plugin configuration. Port 5005 is the default.

What's next

Send feedback about...

Cloud Tools for IntelliJ