# Deploy to the App Engine Flexible Environment in Cloud Code for IntelliJ

> [!CAUTION]
> **Caution:** As of January 31, 2024, Java 8 support for App Engine has ended, and will be deprecated on January 31, 2026. As a result, Cloud Code disables App Engine by default. To enable App Engine in your IDE, navigate to **Settings** \> **Google
> Cloud Code** \> **App Engine** . For more information about the runtime support schedule for App Engine, see [Runtime support schedule](https://docs.cloud.google.com/appengine/docs/standard/lifecycle/support-schedule).

This document describes how to deploy an App Engine application to the
[App Engine flexible
environment](https://docs.cloud.google.com/appengine/docs/flexible)
from within IntelliJ IDEA.

> [!NOTE]
> **Note:** The following IDEs support this feature:
>
> - IntelliJ IDEA - Ultimate
> - IntelliJ IDEA - Community

> [!NOTE]
> **Note:** Only Java applications are supported.

## Before you begin

- Follow the [Create an App](https://docs.cloud.google.com/code/docs/intellij/create-flexible)
  guide to install and set up Cloud Code as well as
  create an App Engine app for the flexible
  environment. Be sure to add
  [App Engine flexible framework
  support](https://docs.cloud.google.com/code/docs/intellij/create-flexible#framework).

  If you don't have an application but still want to try these deployment
  procedures, download the sample app:
  1. Clone the **Spring Boot** sample app to your local machine:

          git clone https://github.com/spring-guides/gs-spring-boot

  2. In IntelliJ, choose **File** \> **Open** to open the file selector.

  3. Navigate to `/gs-spring-boot/`.

  4. Select the `/complete/` directory.

  5. Click **OK**.

  6. Add [App Engine flexible framework
     support](https://docs.cloud.google.com/code/docs/intellij/create-flexible#framework).

## Creating the deployment configuration

1. Choose **Tools** \> **Cloud Code** \> **App Engine** \>
   **Deploy to App Engine**.

2. Confirm the server configuration:

   1. Click the ellipsis (...) next to the **Server** field.

   2. In the dialog, verify that the **Name** field displays
      **Google App Engine**.

   3. Click **OK**.

3. Select the **Deployment** source.

   Cloud Code for IntelliJ supports deploying from a Maven artifact, an
   IntelliJ-specific artifact, or a filesystem JAR or WAR file.
   1. If you select a filesystem JAR or WAR file as your deployment source, click the ellipsis (...) next to the **Deployment archive** field to navigate to the deployment archive.
4. Select a project in the **Project** field.

   The first time you configure the deployment, you will be prompted to sign in
   to the account associated with the Google Cloud console project that
   you want to deploy.
5. In the **App Engine Flexible Configuration** section, select a
   valid `app.yaml` file.

   1. If you don't see a valid `app.yaml` file in the drop-down menu, click **Edit** to select a file. See the [Update the App Engine
      flexible configurations](https://docs.cloud.google.com/code/docs/intellij/deploy-flex#config) section for more information.
6. Fill in other fields as needed to configure the deployment.

7. Click **Run** to build and deploy your app.

8. In the Application Servers window, click the name of your project to monitor
   its deployment progress. If the window is not displaying, click
   **View** \> **Tool Windows** \> **Application Servers**.

   After deployment completes, you can view your app's URL in the console
   output.

## Deploying to a custom runtime

You can modify your `app.yaml` file to deploy your app to a custom runtime
using a Docker file.

1. In your `app.yaml` file, set your runtime to **custom**.

2. As you complete the [creating the deployment configuration](https://docs.cloud.google.com/code/docs/intellij/deploy-flex#deploy) steps,
   the **App Engine Flexible Configuration** section displays the path
   to your `app.yaml` and Docker file.

3. Click **Edit** to select valid `app.yaml` and Docker files.

4. Click the ellipsis (...) next to the `app.yaml` and the **Dockerfile
   Directory** fields to navigate to the appropriate files.

5. Click **OK**.

## Update the App Engine flexible configurations

After creating the initial deployment configuration, you can make changes to
those configurations as needed by your application.

1. Select **File** \> **Project Structure**.

   The **Project Structure** dialog displays.
2. Under **Project Settings** , select **Facets**.

3. Select the App Engine flexible facet.

4. To select an `app.yaml` file, click the ellipsis (...) next to the
   **app.yaml** field to navigate to the location of a valid file.

5. If you deploy to a custom runtime, click the ellipsis (...) next to the
   **Dockerfile directory** field to navigate to the location of a valid file.

6. Click **OK**.

## Deleting the server

If you ever want to delete the server you configured for your
project, you can do so as follows:

1. Choose **File** \> **Settings** \> **Build, Execution, Deployment** \>
   **Clouds**.

   On macOS, this is **IntelliJ IDEA** \> **Preferences** \>
   **Build, Execution, Deployment** \> **Clouds**.
2. Select your server (App Engine) and click the minus sign (-) at the
   top of the window to remove it.

3. Click **OK**.

## What's next

- You can add your project to [Cloud Source Repositories](https://docs.cloud.google.com/code/docs/intellij/vcs) if you haven't done so already.

## Get support

To submit feedback or report an issue in your IntelliJ IDE, go to
**Tools** \> **Cloud Code** \> **Help / About** \> **Submit
feedback or report an issue** to report an issue on [GitHub](https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues).