Deploy your web service Stay organized with collections Save and categorize content based on your preferences.
Region ID
TheREGION_ID is an abbreviated code that Google assignsbased on the region you select when you create your app. The code does notcorrespond to a country or province, even though some region IDs may appearsimilar to commonly used country and province codes. For apps created after February 2020,REGION_ID.r is included in App Engine URLs. For existing apps created before this date, the region ID is optional in the URL.
Learn moreabout region IDs.
This section of the guide shows how to use the gcloud CLI to deploy yourJava web service on App Engine. To learn more aboutthe Java runtime environment, seeJava Runtime Environment.
Before you begin
- Create a Google Cloud project with an App Engine app.
- Write a Java web server ready to deploy on App Engine.
- Install Google Cloud CLI, which provides the
gcloudcommand-linetool. Ensuregcloudis configured to use the Google Cloud project you want todeploy to.
Key points
- Use
gcloud app deployandgcloud app browseto deploy and view yourservice.
Deploy your service
In yourmy-java-service folder, where your Maven POM orGradle build file is located, run the following command in your terminal:
gcloudappdeployYour source files are then uploaded to Cloud Storage. Cloud Buildbuilds your app and deploys it to App Engine.
Note: Files listed in your.gcloudignorefile will not be uploaded.Deploy multiple services
You can add multiple services in your project by creating anapp.yaml file for each service. Include theservice attribute in eachapp.yaml file to specify the name of the service.To learn more about structuring your app using multiple services, seeStructuring Web Services in App Engine.
To deploy multiple services, followthese instructions
Each deployed service will have its own assigned URL.
View your service
To quickly launch your browser and access your web service athttps://PROJECT_ID.REGION_ID.r.appspot.com, use the followingcommand:
gcloudappbrowseServices and versions
You've just created and deployed a service on App Engine.You can specify the name of your service in theapp.yaml file. If thename is omitted, it is treated asdefault. The first service you deploymust be the default service.
You can update your service at any time by running thegcloud app deploycommand again. Each time you deploy, a new version is created and trafficis automatically routed to the latest version.
To confirm that your service has been created and a version has been deployed:
View your App Engine services in the Google Cloud console:
You should see one service listed, named
default. The default service ispublicly accessible at the following URL:https://PROJECT_ID.REGION_ID.r.appspot.comView your versions:
You should see one timestamped version listed, corresponding to yourdeployment.
To learn how to send requests to specific services and versions, seeHow Requests are Routed.
Next steps
Congratulations! You built an application that can store and classify uploadedimages. Learn how to add other features to your application by exploring thefollowing pages:
- See more Java code samples for the App Engine standard environmenton theGoogle Cloud GitHub repository.. These samples can be used for both Java.
- Learn more about writing application logs and interpreting system logs inReading and writing application logs.
- For a deeper dive into how App Engine works, see theJava runtime environment.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.