All Products
Search
Document Center

Serverless App Engine:Configure startup commands

Last Updated:Jan 09, 2026

When you deploy an application from a container image or a code package in the SAE console, SAE starts the container using preset startup parameters. You can define a custom startup command in SAE to apply special configurations, such as for Nginx, or to overwrite the default startup parameters of the image.

Feature entry point

The access method varies depending on the scenario:

Create an application

  1. Log on to the SAE console. In the navigation pane on the left, choose Application Management > Application List. Select a destination region and namespace, and then click Create Application.

  2. On the Basic Information page, configure the parameters and click Next: Advanced Settings.

Modify a running application

Warning

After you redeploy an application, the application is restarted. To prevent unpredictable errors such as business interruptions, we recommend that you deploy applications during off-peak hours.

  1. Log on to the SAE console. In the navigation pane on the left, choose Application Management > Application List. Select a destination region and namespace, and then click the name of the target application.

  2. On the Basic Information page of the application, click Deploy Application.

Modify a stopped application

  1. Log on to the SAE console. In the navigation pane on the left, choose Application Management > Application List. Select a destination region and namespace, and then click the name of the target application.

  2. On the Basic Information page of the application, click Modify Application Configurations.

Configure startup commands for an application

Applications deployed from an image

You do not typically need to configure a startup command. This is because when you create an image, the container's startup command is already configured using ENTRYPOINT or CMD in the Dockerfile.

For example, the following command that is set in a Dockerfile runs when the container starts.

ENTRYPOINT [nginx, '-g', 'daemon off;']                

To overwrite the startup command configured in the Dockerfile, perform the following steps:

  1. In the Startup Command section, set Script Interpreter to >_ /bin/sh or >_ /bin/bash. Ensure that the image includes the selected script interpreter.

  2. Configure the startup command for the container. The following examples show the required format:

    • >_ /bin/sh

      sh -c 'while true; do echo hello; sleep 10;done'
    • >_ /bin/bash

      bash -c 'while true; do echo hello; sleep 10;done'

    sBXB3VO8G5

Important

If you are not familiar with the ENTRYPOINT and CMD configurations in the original Dockerfile, do not customize or modify the startup command or parameters. An incorrect startup command will cause the application creation to fail.

Applications deployed from a JAR package

A Java application requires a startup command and parameters to start and run, such as Java Virtual Machine (JVM) parameters and garbage collection (GC) policies.

SAE automatically compiles the uploaded JAR package into an image and runs the application in a container. During this process, SAE uses a built-in startup command and parameters, and specifies the storage path for the JAR package. You can log on to the SAE console to modify the default startup command and its parameters.

In the Startup Command Settings section, specify the configuration items. The following is an example of a startup command.

dQolzyE4Iu

Configuration item

Description

Default startup command

The default startup command provided by SAE.

options settings

Configure JVM parameters. For more information, see JVM parameter configuration, Tuning Java Virtual Machines, and JVM Tuning: How to Prepare Your Environment for Performance Tuning.

To use the remote debugging feature for the application, configure the required command based on the JDK version.

  • JDK 11 and JDK 17

    -agentlib:jdwp=transport=dt_socket,address=*:9000,server=y,suspend=n
  • Other JDK versions

    -agentlib:jdwp=transport=dt_socket,address=9000,server=y,suspend=n

The parameters are described as follows.

  • transport: The data transmission method for remote debugging.

  • address: The remote debugging address. This must be the same as the debugging port you set when you enabled remote debugging. For more information about remote debugging, see Remote debugging.

Important

The startup commands for applications deployed from WAR packages and JAR packages are different. Do not use the same startup command for both deployment methods. The remote debugging command in this example applies to both deployment methods.

args settings

Configure the redirection command for standard output and standard error, such as 1>>/tmp/std.log>&1.

Applications deployed from a WAR package

In the Startup Command Settings section, specify the configuration items. The following is an example of a startup command.

nGwm0XDLnO

Configuration item

Description

Default startup command

The default startup command provided by SAE.

options settings

Configure JVM parameters. For more information, see JVM parameter configuration, Tuning Java Virtual Machines, and JVM Tuning: How to Prepare Your Environment for Performance Tuning.

To use the remote debugging feature for the application, configure the required command based on the JDK version.

  • JDK 11 and JDK 17

    -agentlib:jdwp=transport=dt_socket,address=*:9000,server=y,suspend=n
  • Other JDK versions

    -agentlib:jdwp=transport=dt_socket,address=9000,server=y,suspend=n

The parameters are described as follows.

  • transport: The data transmission method for remote debugging.

  • address: The remote debugging address. This must be the same as the debugging port you set when you enabled remote debugging. For more information about remote debugging, see Remote debugging.

Important

The startup commands for applications deployed from WAR packages and JAR packages are different. Do not use the same startup command for both deployment methods. The remote debugging command in this example applies to both deployment methods.

Applications deployed from a ZIP package

In the Startup Command section, select a script type and configure the startup command for the container.

  • >_ /bin/sh

    sh -c 'gunicorn -w 3 -b 0.0.0.0:8080 app.hello:app'
  • >_ /bin/bash

    bash -c 'gunicorn -w 3 -b 0.0.0.0:8080 app.hello:app'

FWP1NqMoGb