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

Running your application locally

To run an App Engine application locally:

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

  2. Browse to the directory containing your project.

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

The project takes a moment to build.

Editing the run configuration

Configure the server

You can edit the run configuration for your local server:

  1. Select Run > Edit Configurations.

    The Run/Debug Configurations dialog displays.

    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.

Add environment variables

If needed, add environment variables to your configuration.

  1. Select the Startup/Connection tab.

  2. Select Run.

  3. Select the Pass environment variables checkbox.

  4. Add the necessary variables.

  5. Select Debug.

  6. Select the Pass environment variables checkbox.

  7. Add the necessary variables.

    Screenshot showing the run/debug configuration dialog, with the
focus on the environment variables for the local server.

  8. 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. Select 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.

Debugging your application locally on Community Edition

IntelliJ Community Edition does not provide native support for running local Java servlet-based applications. To debug your application locally using IntelliJ Community Edition, configure your project to use the Maven or Gradle plugin.

Maven

Configuring your project using the Maven plugin

  1. Add the App Engine Maven plugin to your project's pom.xml file.

  2. Configure debugging on a development server.

  3. Create Run/Debug configuration for Maven.

    Screenshot showing the Run/Debug Configurations dialog.

    1. Select Run > Edit Configurations.

    2. Click plus (+) to add a new configuration.

    3. Select Maven.

    4. In the Command line field, enter appengine:run.

    5. Click OK.

  4. Create a remote debug configuration.

    Screenshot showing the Run/Debug Configurations
dialog.

    1. Select Run > Edit Configurations.

    2. Click the plus (+) to add a new configuration.

    3. Select Remote.

    4. Ensure that the port number is the same as the port you configured in your Maven App Engine plugin configuration. Port 5005 is the default.

    5. In the Before launch section click plus (+).

    6. Select Run Another Configuration.

    7. Select the run configuration for your Maven project.

    8. Click OK.

  5. To debug your application locally:

    1. Select Run > Debug.

    2. Select your remote debug configuration.

      Screenshot showing the Run/Debug Configurations
dialog.

      You can now debug your application locally.

Gradle

Configuring your project using the Gradle plugin

  1. Create a new Gradle project.

  2. Configure debugging on a development server.

  3. Create Run/Debug configuration for Gradle.

    Screenshot showing the Run/Debug Configurations dialog.

    1. Select Run > Edit Configurations.

    2. Click plus (+) to add a new configuration.

    3. Select Gradle.

    4. In the Gradle project field, select the module where you configured the appengine-gradle-plugin plugin.

    5. In the Tasks field, enter appengineRun.

    6. Click OK.

  4. Create a remote debug configuration.

    Screenshot showing the debug Configurations
dialog.

    1. Select Run > Edit Configurations.

    2. Click the plus (+) to add a new configuration.

    3. Select Remote.

    4. Ensure that the port number is the same as the port you configured in your Maven App Engine plugin configuration. Port 5005 is the default.

    5. In the Before launch section click plus (+).

    6. Select Run Another Configuration.

    7. Select the run configuration for your Maven project.

    8. Click OK.

  5. To debug your application locally:

    1. Select Run > Debug.

    2. Select your remote debug configuration.

      Screenshot showing the debug Configurations
dialog.

      You can now debug your application locally.

What's next

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud Tools for IntelliJ
Need help? Visit our support page.